Skip to content

Instantly share code, notes, and snippets.

View akofman's full-sized avatar
⚙️
Remote Deep Learner

Alexis Kofman akofman

⚙️
Remote Deep Learner
View GitHub Profile
@akofman
akofman / console-tips.md
Last active August 29, 2015 14:12
Chrome console tips

Copy the text document :

copy(document.getElementById('content').innerText) 

Kill an application/process on a non-rooted device :

adb shell run-as <package-name> kill <pid>
@akofman
akofman / memoization.js
Last active August 19, 2016 08:38
JS Memoization example.
//To run this example : node memoization.js
'use strict'
var start, result, end;
var fibo = function fibonacci(n) {
if (n < 2) {
return n;
} else {
@akofman
akofman / 51-android.rules
Created July 4, 2014 13:07
Android rules file that contains a USB configuration for each type of device you want to use for development.
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
#Acer 0502
#ASUS 0b05
#Dell 413c
#Foxconn 0489
#Fujitsu 04c5
#Fujitsu Toshiba 04c5
#Garmin-Asus 091e
#Google 18d1
@akofman
akofman / jsreminders.md
Last active August 29, 2015 14:01
JavaScript Reminders

Easily parse an url with JavaScript :

var url = document.createElement('a');
url.href = 'http://www.mydomain.com/path?param=value'

and then we can access every properties of this element : http://www.w3schools.com/jsref/dom_obj_anchor.asp such as :

url.pathname //=>/path 
@akofman
akofman / freeebooks.md
Last active August 29, 2015 14:00
Some links to free e-books

1. Having two branches, branch1 and branch2, to know which commits are in branch1 but not in branch2 :
git checkout branch1
git cherry -v branch2

the output will be something like :

@akofman
akofman / osxreminders.md
Last active January 26, 2016 13:18
OSX Reminders

List TCP connections which are in LISTEN state :

lsof -P -iTCP -sTCP:LISTEN

List MAC addresses on a local network (192.168.0.0/24) :

sudo arp-scan 192.168.0.0/24