Skip to content

Instantly share code, notes, and snippets.

View dclowd9901's full-sized avatar

David Drew dclowd9901

  • Litchfield Park, AZ
View GitHub Profile
@dclowd9901
dclowd9901 / gist:efa6c4f37915b8f3794d
Last active August 29, 2015 14:19
Pathfinder: Find all permutations of values that add up to a value
/**
* first - the starting values
* total - the value you want all values to add to
* optimal - the preferred final value of the sequence
*
* returns false if no path can be found to the answer
*/
function pathfinder(first, total, optimal) {
var start = first - 1,
@dclowd9901
dclowd9901 / gist:5f8d8d1da35a7e225f29
Created May 7, 2015 16:49
Copy Hosts to Genymotion Android
ip="$(ifconfig | grep -A 1 'en0' | tail -1 | cut -d ':' -f 2 | cut -d ' ' -f 2)"
/Applications/Genymotion.app/Contents/MacOS/tools/adb root
/Applications/Genymotion.app/Contents/MacOS/tools/adb remount
cat /etc/hosts|sed 's/127.0.0.1/'$ip'/' > /tmp/hosts-adb
/Applications/Genymotion.app/Contents/MacOS/tools/adb push /tmp/hosts-adb /system/etc/hosts
-----5-----------5---------7-----8-7-8-7------------
-----------------------------------------8----------
---5-----------5---------------------------9--------
-7-----------7--------------------------------------
----------------------------------------------------
-5---5---5---7---7---------8---8---8---7---7--------
-1--- -1--- -2-4- -2---
----- ----- ----- --3--
-1--- -1--- ----- ---4-