This file contains 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 sys = require('sys'), url = require("url"), path = require("path"), fs = require("fs"), | |
querystring = require("querystring"), folder = "/", port = process.argv[3] || 25565; | |
var server = require("http").createServer(HTTP_Server).listen(parseInt(port, 10)); | |
function HTTP_ProcessPost(request, response, callback) { | |
var queryData = ""; | |
if(typeof callback !== 'function') return null; |
This file contains 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 fs = require('fs'); | |
var url = require('url'); | |
var path = require("path"); | |
var request = require('sync-request'); | |
var base_url = "https://ajax.googleapis.com/ajax/services/search/images?v=1.0&q="; | |
function downloadImages(type) { | |
var res = JSON.parse(request('GET', base_url + type + '&as_filetype=' + type + '&start=' + Math.floor((Math.random() * 50) + 1)).body.toString('utf-8')); | |
if(res['responseData']['results']) { | |
var images = res['responseData']['results']; |
This file contains 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 fs = require('fs'); | |
var sites = [ | |
'example.com', | |
'test.com' | |
]; | |
if(process.argv[2]) { | |
if(process.argv[2] == 'enable' || process.argv[2] == 'disable') { |
This file contains 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
#! /bin/bash | |
find "$1" -type f -name "*.$2" -printf "%s\t%p\n" | sort -n -r | tail -1; | |
find "$1" -type f -name "*.$2" -printf "%s\t%p\n" | sort -n | tail -1; |
This file contains 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
# list all packages | |
adb -dshell pm list packages | |
# get full apk path | |
adb -d shell pm path <package name> | |
# pull it | |
adb pull <path to apk> <local path> |
This file contains 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
" luveti - vimrc - 9/8/16 | |
" these 4 lines are required by Vundle | |
set nocompatible | |
filetype off | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" list our plugins, Vundle needs to be the first one | |
Plugin 'VundleVim/Vundle.vim' |
This file contains 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
function require (urls, cb) { | |
if (!Array.isArray(urls) && typeof urls === 'string') urls = [urls]; | |
var modules = []; | |
var i = 0, next = function () { | |
fetch(urls[i]) | |
.then(function (response) { | |
return response.text(); | |
}) | |
.then(function (code) { | |
try { |
This file contains 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
#!/usr/bin/env node | |
const path = require("path") | |
const fs = require("fs") | |
// https://gist.github.com/luveti/67a1c93be3d58b085f6c76ae876c556c | |
function installDeps(deps, quiet, cb) { | |
const hash = require('crypto').createHash('md5').update(__filename).digest('hex') | |
const dir = require('os').tmpdir() + require('path').sep + hash | |
try { |
This file contains 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
function installDeps(deps, quiet, cb) { | |
const hash = require('crypto').createHash('md5').update(__filename).digest('hex') | |
const dir = require('os').tmpdir() + require('path').sep + hash | |
try { | |
require('fs').mkdirSync(dir) | |
if (!quiet) console.log(`Created temp folder at "${dir}"`) | |
} catch (e) {} | |
try { | |
require('fs').writeFileSync(dir + require('path').sep + 'package.json', JSON.stringify({ | |
name: hash, description: hash, author: hash, repository: hash, license: "ISC", |
This file contains 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
function promisifyAll(module, callbackParameterName) { | |
const util = require('util') | |
function isFunction(f) { | |
return f && Object.prototype.toString.call(f) === '[object Function]' | |
} | |
if (!callbackParameterName) callbackParameterName = 'callback' | |
Object.keys(module) |
OlderNewer