Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jeffmjack
jeffmjack / russian_roots.ANKI
Created July 21, 2016 15:27
Anki file with corrected field number issues for russian roots from https://www.reddit.com/r/russian/comments/3tt1sl/list_of_352_russian_roots/
алк; hungry, greedy
алкать; to be hungry/greedy/thirsty for, to long for
алчный; greedy
алчность; greed
ау; halloo, echo
аукать // аукнуть; to halloo, shout, cry out
ауканье; echo, halloo
ба; talk, saying, chatter, tell stories
@jeffmjack
jeffmjack / gist:dd19ebeca1d30438a2eb
Last active November 21, 2015 01:29
remove empty img boxes on small screens
<picture >
<source
media="(min-width: 768px)"
sizes="66vw"
srcset="images/3x768.jpg 768w,
images/3x1200.jpg 1200w,
images/3x2000.jpg 2000w,
"
/>
<img
@jeffmjack
jeffmjack / gist:101251e5b23d30f41504
Created October 26, 2015 16:07
Is this the best way to use lookups in a routing table?
// list ID routing table -
var listIDTable = {
10 'realEstateInvestor': '6789',
11 'homepageSignup': '1234',
12 'realEstateAgent': ''
13 }
14
15
16 function sendToMailChimp (payload, callback) {
// I'm running a node server behind nginx.
// curling the appropriate URL for this app server works as expected, printing 'hello, world'
// to the client's console.
var http = require('http');
var requestListener = function (req, res) {
res.writeHead(200);
res.end('Hello, World!\n');
}
//crontab -e
MAILTO="me@gmail.com"
1 * * * * me /usr/local/bin/node Users/jeffmjack/code/test/hello.js
// ~/code/test/hello.js:
console.log('hello');
// running $ node hello.js manually works as expected
scrapeCity(seed, callback);
function callback (err, res){
q.all(res.nearbyCities.map(scrapeCity))
.then(function (cities) {
console.log(cities);
})
.done();
}
// prints a bunch of stuff indicating the map function has run for all the objects it's supposed to run on, then errors on:
module.exports = function (grunt) {
'use strict';
// Project configuration
grunt.initConfig({
// Metadata
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
module.exports = function (grunt) {
'use strict';
// Project configuration
grunt.initConfig({
// Metadata
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
.block {
//used for composing elements, based on 1/4 us-map image width
width: 86px;
height: 22px;
display: inline-block;
}
#wrapper {
background-color: white;
width: 1040px;