Skip to content

Instantly share code, notes, and snippets.

View jtmkrueger's full-sized avatar
🎉
Working from home

John Krueger jtmkrueger

🎉
Working from home
View GitHub Profile

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jtmkrueger
jtmkrueger / gist:6158238
Created August 5, 2013 18:30
fire function on esc with jqeury
var that = this;
$(document).keyup(function(e) {
if (e.keyCode == 27) { that.closePopup(e); }   // esc
});

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
'use strict';
var LIVERELOAD_PORT = 35729;
var SERVER_PORT = 9000;
var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT});
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
// # Globbing
// for performance reasons we're only matching one level down:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Mocha Spec Runner</title>
<link rel="stylesheet" href="bower_components/mocha/mocha.css">
</head>
<body>
<div id="mocha"></div>
@jtmkrueger
jtmkrueger / README.md
Last active August 29, 2015 14:06 — forked from agnoster/README.md

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@jtmkrueger
jtmkrueger / bairep
Created September 17, 2014 17:47
broken attachments in rails_email_preview
Started GET "/FleetDASH/emails/campaign_mailer_preview-p_positive/attachments/training_button.png" for 127.0.0.1 at 2014-09-17 11:44:40 -0600
Processing by RailsEmailPreview::EmailsController#show_attachment as PNG
Parameters: {"email_locale"=>:en, "preview_id"=>"campaign_mailer_preview-p_positive", "filename"=>"graph_1"}
Processing by RailsEmailPreview::EmailsController#show_attachment as PNG
Parameters: {"email_locale"=>:en, "preview_id"=>"campaign_mailer_preview-p_positive", "filename"=>"graph_2"}
Processing by RailsEmailPreview::EmailsController#show_attachment as PNG
Parameters: {"email_locale"=>:en, "preview_id"=>"campaign_mailer_preview-p_positive", "filename"=>"header"}
(1.0ms) SET search_path TO fleetdash,public
Completed 404 Not Found in 32ms
Completed 404 Not Found in 43ms
# controller
def show
render :xlsx => 'show', :filename => 'simple.xlsx'
end
#show.xlsx.axlsx
Axlsx::Package.new do |p|
p.workbook.add_worksheet(:name => "Test") do |sheet|
# sheet.add_row [@final_report.id, @final_report.reporting_date, @final_report.created_at]
@jtmkrueger
jtmkrueger / batch_three_export.py
Created March 31, 2016 21:12
Batch export all objects in the scene as seperate three.js json files
import bpy
import os
# Batch exporting of all objects in the scene into separate json files
# access the scene
scene = bpy.context.scene
# get the current path and make a new folder for the exported meshes
path = bpy.path.abspath('//' + bpy.path.basename(bpy.context.blend_data.filepath) + '_jsonexport/')
~
▶ pkgin -f up
cleaning database from http://pkgsrc.joyent.com/packages/Darwin/2015Q3/x86_64/All entries...
processing remote summary (http://pkgsrc.joyent.com/packages/Darwin/trunk/x86_64/All)...
pkg_summary.xz 0% 0 0.0KB/s 0.0KB/s --:-- ETAcleaning database from http://pkgsrc.joyent.com/packages/Darwin/trunk/x86_64/All entries...
pkg_summary.xz 100% 1776KB 888.2KB/s 944.4KB/s 00:02
~
▶ pkgin