Skip to content

Instantly share code, notes, and snippets.

View surjikal's full-sized avatar
👁️‍🗨️

Nick Porter surjikal

👁️‍🗨️
  • CTO @ 42
  • Oakland
View GitHub Profile
!function(a,b){"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?module.exports=b():a.download=b()}(this,function(){return function a(b,c,d){function q(a){var b=a.split(/[:;,]/),c=b[1],d="base64"==b[2]?atob:decodeURIComponent,e=d(b.pop()),f=e.length,g=0,h=new Uint8Array(f);for(g;g<f;++g)h[g]=e.charCodeAt(g);return new l([h],{type:c})}function r(a,b){if("download"in j)return j.href=a,j.setAttribute("download",m),j.className="download-js-link",j.innerHTML="downloading...",j.style.display="none",document.body.appendChild(j),setTimeout(function(){j.click(),document.body.removeChild(j),b===!0&&setTimeout(function(){e.URL.revokeObjectURL(j.href)},250)},66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return a=a.replace(/^data:([\w\/\-\+]+)/,f),window.open(a)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=a),!0;var c=document.createElement("iframe");document.body.appe
@surjikal
surjikal / tweaks-commented.sh
Created September 9, 2016 23:41 — forked from Tristor/tweaks
OSX Dev Tweaks
#!/usr/bin/env bash
# Disable the sound effects on boot
sudo nvram SystemAudioVolume=" "
# Disable transparency in the menu bar and elsewhere on Yosemite
defaults write com.apple.universalaccess reduceTransparency -bool true
# Menu bar: hide the Time Machine, Volume, and User icons
for domain in ~/Library/Preferences/ByHost/com.apple.systemuiserver.*; do
defaults write "${domain}" dontAutoLoad -array \
"/System/Library/CoreServices/Menu Extras/TimeMachine.menu" \
"/System/Library/CoreServices/Menu Extras/Volume.menu" \
package main
import (
"path/filepath"
"os"
"flag"
"fmt"
"time"
)
@surjikal
surjikal / install.md
Last active July 23, 2018 19:05
Presto Installation Instructions for OSX
  1. Install JDK 1.8

  2. See if JAVA_HOME ENV variable is set to 1.8. If not, add this line in your ~/.bashrc:

    export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
    

    And apply the changes to your session:

source ~/.bashrc

@surjikal
surjikal / macos-openssh-portable.sh
Last active February 1, 2024 23:21
Compile OpenSSH Portable on OSX / MacOS
#!/usr/bin/env bash
brew install openssl
git clone git://anongit.mindrot.org/openssh.git
cd openssh
# The './configure' script does not exist, so we have to build it
autoreconf
@surjikal
surjikal / gentoo-minicron.md
Last active August 29, 2015 14:06
gentoo-minicron.md

Repo URL:
https://github.com/jamesrwhite/minicron

Info

The idea here is that one server holds the "hub", aka the Minicron server. The other servers are simply clients. We use ssh tunneling from clients to communicate with the server. The server should be able to ssh into the client machines, in order to modify the client's crontab. We add public keys with a prefix that only allow root ssh access from a single IP (the server's IP).

@surjikal
surjikal / sudoku.coffee
Last active August 29, 2015 14:05
Sudoku Solver
# board = [
# 1,2,3,4,5,6,7,8,9
# 4,5,6,1,7,8,3,3,3
# 7,8,9,2,2,2,1,4,5
# 3,5,6,7,8,9,9,9,9
# 1,4,9,3,6,6,6,6,6
# 7,7,7,1,4,5,3,3,3
# 2,4,5,8,8,8,8,8,8
# 1,7,7,2,5,5,5,5,5
# 7,7,7,4,1,1,null,null,null
@surjikal
surjikal / app.coffee
Last active August 29, 2015 14:02
Sears Hackathon
_ = require 'lodash'
ent = require 'ent'
assert = require 'assert'
Promise = require 'bluebird'
SearsAPI = require './sears-api'
CONSUMER_KEY = '<your key here>'
var app = angular.module('converter', []);
app.directive('converter', function(converters) {
return {
require: 'ngModel',
link: function(scope, element, attr, ngModel) {
var converter = converters[attr.converter];
ngModel.$formatters.unshift(converter.formatter);
ngModel.$parsers.push(converter.parser);
},
@surjikal
surjikal / crawler-barneys.coffee
Last active August 12, 2019 14:41
crawler for subset of barneys.com
_ = require 'lodash'
Crawler = require('crawler').Crawler
assert = require 'assert'
Promise = require 'bluebird'
request = require 'request'
fs = require 'fs'
TOP_LEVEL_CATEGORIES = [
'women'