Skip to content

Instantly share code, notes, and snippets.

@Den1al
Den1al / aiohttp-example.py
Last active June 22, 2023 12:53
concurrent http requests with aiohttp
# author: @Daniel_Abeles
# date: 18/12/2017
import asyncio
from aiohttp import ClientSession
from timeit import default_timer
import async_timeout
async def fetch_all(urls: list):
@nieldeokar
nieldeokar / SimpleVibrateDemoActivity.java
Last active September 1, 2023 11:04
Android Vibrate & VibrationEffect class demo Usage
package com.example.nileshdeokar.simplevibratedemo;
import android.os.Build;
import android.os.VibrationEffect;
import android.os.Vibrator;
import android.support.annotation.RequiresApi;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;
/*
@subfuzion
subfuzion / dep.md
Last active July 25, 2024 03:38
Concise guide to golang/dep

Overview

This gist is based on the information available at golang/dep, only slightly more terse and annotated with a few notes and links primarily for my own personal benefit. It's public in case this information is helpful to anyone else as well.

I initially advocated Glide for my team and then, more recently, vndr. I've also taken the approach of exerting direct control over what goes into vendor/ in my Dockerfiles, and also work from isolated GOPATH environments on my system per project to ensure that dependencies are explicitly found under vendor/.

At the end of the day, vendoring (and committing vendor/) is about being in control of your dependencies and being able to achieve reproducible builds. While you can achieve this manually, things that are nice to have in a vendoring tool include:

@tao12345666333
tao12345666333 / Python3.6-build-on-CentOS7.txt
Created June 22, 2017 04:15
Python3.6 source code build on CentOS 7.3
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_dbm _gdbm _lzma
_sqlite3 _tkinter readline
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
so.
sudo yum install gdbm-devel tk-devel xz-devel sqlite-devel readline-devel bzip2-devel ncurses-devel zlib=devel
@guipmourao
guipmourao / ubuntu16.04-command-line-install-android-sdk
Created March 15, 2017 12:17
Ubuntu 16.04 command line install android sdk
# create sdk folder
export ANDROID_HOME=/opt/android-sdk-linux
sudo mkdir -p $ANDROID_HOME
# install openjdk
sudo apt-get install openjdk-8-jdk
# download android sdk
cd $ANDROID_HOME
sudo wget https://dl.google.com/android/repository/tools_r25.2.3-linux.zip
@suriya
suriya / console-log-14.04.txt
Last active April 29, 2019 07:10
Demonstrating that Gunicorn does not respond immediately to SIGTERM (with Python 3.5)
The script run-and-stop-gunicorn.sh takes 1 second on both Python 2.7 and 3.4.
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.2 LTS"
$
$
$ source 27-env/bin/activate
@nstarke
nstarke / release-android-debuggable.md
Last active September 9, 2024 22:05
How to make a Release Android App debuggable

How to make a Release Android App debuggable

Let's say you want to access the application shared preferences in /data/data/com.mypackage.
You could try to run adb shell and then run-as com.mypackage ( or adb shell run-as com.mypackge ls /data/data/com.mypackage/shared_prefs), but on a production release app downloaded from an app store you're most likely to see:

run-as: Package 'com.mypackage' is not debuggable
@dotku
dotku / Linux 常用命令锦集.md
Last active February 22, 2017 11:11
Linux 相关的内容
  1. 查看版本

     # Finding your kernel release
     $ uname -r
     > 3.16.0-34-generic
     
     # Finding your distribution release
     $ lsb_release -a
     > Distributor ID: Ubuntu  
    

> Description: Ubuntu 14.10

@subfuzion
subfuzion / curl.md
Last active September 20, 2024 18:43
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@iann0036
iann0036 / auto.py
Last active February 2, 2024 04:06
Python Input Record and Play
import pyautogui, time, sys, os, win32api, win32gui, win32con, datetime, pyHook, pythoncom
from optparse import OptionParser
'''
Python Automated Actions Script by Ian Mckay
Version 0.1 - 20151217
'''
pyautogui.PAUSE = 0
pyautogui.FAILSAFE = True