This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var browserify = require('gulp-browserify'); | |
var concat = require('gulp-concat'); | |
var styl = require('gulp-styl'); | |
var refresh = require('gulp-livereload'); | |
var lr = require('tiny-lr'); | |
var server = lr(); | |
var paths = { | |
js: 'src/**/*.js', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat package.json | underscore extract devDependencies | underscore keys --outfmt=text | xargs npm install --save-dev | |
cat package.json | underscore extract dependencies | underscore keys --outfmt=text | xargs npm install --save |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var browserify = require('gulp-browserify'); | |
var less = require('gulp-less'); | |
var concat = require('gulp-concat'); | |
var jshint = require('gulp-jshint'); | |
var outDir = './temp'; | |
var sources = { | |
scripts: './app/scripts/**/*.js', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var gutil = require('gulp-util'); | |
var express = require('express'); | |
var path = require('path'); | |
var tinylr = require('tiny-lr'); | |
var createServers = function(port, lrport) { | |
var lr = tinylr(); | |
lr.listen(lrport, function() { | |
gutil.log('LR Listening on', lrport); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String byteArrayToHex(byte[] paramArrayOfByte, int paramInt1, int paramInt2) | |
{ | |
byte[] arrayOfByte = new byte[paramInt2]; | |
for (int i = 0; ; i++) | |
{ | |
if (i >= paramInt2) | |
return ByteUtility.bytesToHex(arrayOfByte); | |
arrayOfByte[i] = paramArrayOfByte[(i + paramInt1)]; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.wificar.component; | |
import android.util.Log; | |
import com.wificar.WificarActivity; | |
import com.wificar.util.BlowFish; | |
import com.wificar.util.ByteUtility; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.nio.ByteBuffer; | |
import org.apache.http.util.ByteArrayBuffer; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var log = function(msg) { | |
return function() { | |
var args = Array.prototype.slice.call(arguments); | |
var cb = args.pop(); | |
console.log(msg); | |
cb.apply(null, [null].concat(args)); | |
}; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var child_process = require('child_process'); | |
var ConnectionConfig = require('mysql/lib/ConnectionConfig'); | |
// first argument = mysql://whatever.com/whatevs | |
// second argument = string of sql file | |
module.exports = function(url, sqlData, cb) { | |
var opt = ConnectionConfig.parseUrl(url); | |
var args = []; | |
if (opt.user) args.push("--user="+opt.user); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var isStorageAvailable = function (storage) { | |
if (typeof storage == 'undefined') return false; | |
try { // hack for safari incognito | |
storage.setItem("storage", ""); | |
storage.getItem("storage"); | |
storage.removeItem("storage"); | |
return true; | |
} | |
catch (err) { | |
return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nodecast = require('nodecast'); | |
var stream = nodecast.find(); | |
stream.on('device', function(device) { | |
console.log('Found device', device.name); | |
var youtube = device.app('YouTube'); | |
// you can change this video to anything you want | |
youtube.start('v=oHg5SJYRHA0', function(err) { |