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 / 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

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 / freeebooks.md
Last active August 29, 2015 14:00
Some links to free e-books
@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 / 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 / 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 {

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

adb shell run-as <package-name> kill <pid>
@akofman
akofman / console-tips.md
Last active August 29, 2015 14:12
Chrome console tips

Copy the text document :

copy(document.getElementById('content').innerText) 
@akofman
akofman / checkIosProvisiongProfile.md
Last active July 28, 2022 14:34
Check devices in a provisioning profile

After exporting an ipa for Ad Hoc Deployment, it could be useful to check if all authorized devices are well configured in a provisioning profile. To read a provisioning profile you have to unarchive your ipa :

$ unzip your.ipa

find the embedded.mobileprovision file :

$ ls yourUnzippedIpa/Payload/appName.app/embedded.mobileprovision
@akofman
akofman / disable-bitcode.js
Last active July 5, 2016 19:57
Cordova hook to disable bitcode for ios9 projects.
#!/usr/bin/env node
/*
* Disable bitcode for ios9 projects.
* versions:
* xcode 0.8.2
* cordova-lib 5.3.3
*/
var xcode = require('xcode');