Skip to content

Instantly share code, notes, and snippets.

View SeanChristopherConway's full-sized avatar

Sean Conway SeanChristopherConway

  • Programmer
  • Sherwood Park, AB, Canada
View GitHub Profile
@SeanChristopherConway
SeanChristopherConway / babelInterpreter.sh
Created February 21, 2018 06:08 — forked from cagataycali/babelInterpreter.sh
Start pm2 process with babel-node interpreter
pm2 start app.js --interpreter ./node_modules/.bin/babel-node
@SeanChristopherConway
SeanChristopherConway / js_var_type.txt
Created February 16, 2018 07:55
Best way to get a javascript variable type
Object.prototype.toString.call(myVar) will return:
"[object Object]" if myVar is an object
"[object Array]" if myVar is an array
@SeanChristopherConway
SeanChristopherConway / git-overwrite-branch.sh
Created January 29, 2018 19:47 — forked from ummahusla/git-overwrite-branch.sh
Git overwrite branch with another branch
# overwrite master with contents of seotweaks branch (seotweaks > master)
git checkout seotweaks # source name
git merge -s ours master # target name
git checkout master # target name
git merge seotweaks # source name
I have made a wifi-ethernet bridge on Raspbian stretch. The trick for me was following the tips from SurferTim on this rasbperrypi forum post with a similar question to yours: https://www.raspberrypi.org/forums/viewtopic.php?t=192377
Anyhow, using those guidelines that worked for me and others, here is what I would do:
#/etc/dnsmasq.conf
interface=eth1
dhcp-range=192.168.2.2,192.168.2.100,12h
#/etc/dhcpcd.conf
@SeanChristopherConway
SeanChristopherConway / zram_install_instructions.txt
Created November 27, 2017 06:25
Install zram on a linux box(tested on raspberry pi jessie, stretch and also on ubuntu 16)
sudo wget -O /usr/bin/zram.sh https://raw.githubusercontent.com/novaspirit/rpi_zram/master/zram.sh
sudo chmod +x /usr/bin/zram.sh
sudo chmod +x /usr/bin/zram.sh
sudo nano /lib/systemd/system/zram.service
---- copy below to the file you just nano'd
[Unit]
Description=Enables zram
After=multi-user.target
@SeanChristopherConway
SeanChristopherConway / save_file.js
Created September 23, 2017 20:56 — forked from timoa/save_file.js
Save file iOS and Android with Appcelerator Titanium Mobile SDK (http://timoa.com/en/2012/07/appcelerator-nativepath-on-ios-and-android/)
// OS
if(Ti.Platform.osname === 'iPhone' || Ti.Platform.osname === 'iPad') {
var ios = true;
}
/**
* Save file function
*
* @file: Binary file (Blob)
* @filename: Name of file (String)
# $1 = module project name, eg. matise.mapbox
# $2 = app name, eg. maptests
# Place this script in your module folder
#Example usage sh build_droid.sh matise.mapbox maptests
cd android;ant;unzip dist/$1*.zip -d tmp;rm -rf "/Users/Sean/Documents/Appcelerator_Studio_Workspace/$2/modules/android/$1" ;cp -R tmp/modules/android/$1 /Users/Sean/Documents/Appcelerator_Studio_Workspace/$2/modules/android;rm -rf tmp;
var RSVP = require('rsvp');
var fakePromise = function (obj) {
var promise = new RSVP.Promise(function (resolve, reject) {
// succeed
resolve({
state: true
});
_ = require('underscore');
var fakeServerCall = function (obj) {
if (obj && obj.id) {
return {
state: true
};
var socket_lib = require("./websocket");
var socket_connector = new socket_lib();
const qs = require("qs");
/*
Current socket server socket.io library is 0.9.16
*/
/*
Connection parameters