Skip to content

Instantly share code, notes, and snippets.

View jakeNiemiec's full-sized avatar
💭
A well-oiled toaster oven

Jake Niemiec jakeNiemiec

💭
A well-oiled toaster oven
  • Professional Worrier
  • Chicago, IL
View GitHub Profile

Rails Generating & Scaffolding

Rails' use of strict naming conventions means a lot of core code SHOULD be in the same format whoever writes it? It could be written by a friend, colleague or a computer... it shouldn't matter because the same Rails rules apply to everyone.

This means that Rails can actually do some tasks for you! It can actually build things and write code on your behalf...

Coming from another language like PHP, this can seem like magic.

@jakeNiemiec
jakeNiemiec / .gitignore
Last active January 2, 2019 22:41 — forked from davebrent/actual.json
Polygon intersection bug
# Created by .ignore support plugin (hsz.mobi)
### Example user template template
### Example user template
# IntelliJ project files
.idea
*.iml
out
gen
node_modules
@jakeNiemiec
jakeNiemiec / .profile
Created July 26, 2017 18:25 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@jakeNiemiec
jakeNiemiec / localStorage.js
Created March 9, 2017 16:08 — forked from anhang/localStorage.js
HTML5 Local Storage with Expiration
AZHU.storage = {
save : function(key, jsonData, expirationMin){
if (!Modernizr.localstorage){return false;}
var expirationMS = expirationMin * 60 * 1000;
var record = {value: JSON.stringify(jsonData), timestamp: new Date().getTime() + expirationMS}
localStorage.setItem(key, JSON.stringify(record));
return jsonData;
},
load : function(key){
if (!Modernizr.localstorage){return false;}
@jakeNiemiec
jakeNiemiec / destructuring.js
Created November 7, 2016 23:33 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];

If you're using SystemJS in the browser, you'll want to update your System config to point at the bundles, if you're not already.

System.config({
  //use typescript for simple compilation (no typechecking)
  //transpiler: 'typescript',
  //typescript compiler options
  //typescriptOptions: {
    //emitDecoratorMetadata: true
  //},
@jakeNiemiec
jakeNiemiec / README.markdown
Created August 22, 2016 20:30 — forked from mccannf/README.markdown
D3 Drag Rectangle with drag handles

This is an example of the power of the D3 library and how you can use the drag behavior of D3 to control the position and shape of the SVG element.

@jakeNiemiec
jakeNiemiec / .block
Created August 12, 2016 20:22 — forked from mbostock/.block
Pierce Tiles
license: gpl-3.0
height: 960
var d3 = require('d3');
var jsdom = require("jsdom-little");
var React = require('react-native');
var { View, Text } = React;
var Svg = require('./Svg');
var parseDate = d3.time.format("%d-%b-%y").parse;
var D3Chart = React.createClass({
componentDidMount() {