Skip to content

Instantly share code, notes, and snippets.

require('shelljs/global');
var files = cat('pdfs.txt').split('\n');
files.forEach(function(file, index) {
if (file.includes('pdf')) {
exec('wget ' + file + ' -O ' + index + '.pdf');
}
});
@veggiemonk
veggiemonk / nginxproxy.md
Last active August 29, 2015 14:26 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@tjweir
tjweir / README.md
Created November 20, 2011 20:00 — forked from pr1001/README.md
Immutable Javascript object properties

Wish you had some immutability in Javascript? Now you can!

var t = {a: 1, b: 2}.immutable();
console.log(t.a, t.b);
try {
  t.a = 3; // ->  Uncaught Error: a is immutable and cannot be modified.
} catch (e) {
  console.log(e);
}

var t2 = t.copy({a: 3});

// The profile model
var profile = require('./profile').get()
profile.then(function() {
AppRouter()
}, function() {
LoginRouter()
})
function AppRouter() {
@gilbert
gilbert / ajax-loader.scss
Created July 8, 2015 16:15
Global Mithril.js AJAX Loader
// Taken from http://loading.io/
uiload {
display: inline-block;
position: relative;
& > div {
position: relative;
}
}
@-webkit-keyframes ajax-loader {
@peteruithoven
peteruithoven / app.js
Last active December 21, 2015 16:05
Rehydrating Redux store when using systemjs hot reloader
import {createStore} from 'redux';
import reducer from './reducers/index.js'
import { rehydrate, rehydratingStore } from './utils/rehydratingStore.js';
const store = rehydratingStore()(createStore)(reducer);
export function __reload(deletedModule){
const prevState = deletedModule.getState();
debug('Reloaded. rehydrate with state: ', prevState.sketcher.objectsById);
store.dispatch(rehydrate(prevState));
@lusis
lusis / gpg-keyservers.txt
Created December 23, 2015 18:51
who cares if our keyservers are actually keyservers.
» for i in `host keys.gnupg.net | grep "has address" | awk -F" " '{ print $4 }'`; do printf -- "ip: $i is match? "; curl -L -q -s -H "Host: pool.sks-keyservers.net" http://$i | html2text | grep -q -i openpgp; if [[ $? -eq 0 ]]; then echo "yes"; else echo "no"; fi; done
ip: 204.61.209.238 is match? no
ip: 46.229.47.139 is match? yes
ip: 66.109.111.12 is match? yes
ip: 67.205.56.66 is match? no
ip: 68.187.0.77 is match? yes
ip: 78.157.209.9 is match? yes
ip: 84.200.66.125 is match? yes
ip: 91.189.90.55 is match? yes
ip: 93.94.119.246 is match? no
@mattdesl
mattdesl / about.md
Last active April 4, 2016 10:04
HMR and CSS injection workflow

budo + LiveReactLoad integration

  • stubs out index.html
  • runs watchify
  • serves on port 9966
  • notifies LiveReactLoad on bundle update
  • reloads HTML with LiveReload
  • injects CSS with LiveReload
  • pretty-prints requests to console
@OverZealous
OverZealous / 1 gulpfile.js
Last active May 26, 2016 19:39
Gulpfile for replicating ngboilerplate
//<editor-fold desc="Node Requires, gulp, etc">
var gulp = require('gulp'),
autoprefixer = require('gulp-autoprefixer'),
clean = require('gulp-clean'),
concat = require('gulp-concat'),
csso = require('gulp-csso'),
debug = require('gulp-debug'),
footer = require('gulp-footer'),
gutil = require('gulp-util'),
gzip = require('gulp-gzip'),
@pr1001
pr1001 / README.md
Created November 20, 2011 15:29
Immutable Javascript object properties

Wish you had some immutability in Javascript? Now you can!

var t = {a: 1, b: 2}.immutable();
console.log(t.a, t.b);
try {
  t.a = 3; // ->  Uncaught Error: a is immutable and cannot be modified.
} catch (e) {
  console.log(e);
}

var t2 = t.copy({a: 3});