Skip to content

Instantly share code, notes, and snippets.

View luetkemj's full-sized avatar
🌄
Working from home

Mark Luetke luetkemj

🌄
Working from home
View GitHub Profile
@brantfaircloth
brantfaircloth / newpost.rb
Created October 3, 2010 07:23 — forked from al3x/newpost.rb
start jekyll post from commandline and stage
#!/usr/bin/ruby
# Create new jekyll post and open in textmate
# $ ruby _new.rb This is the title
# The arguments form the title
unless ARGV[0]
raise "Please provide a post title."
end
@artero
artero / launch_sublime_from_terminal.markdown
Last active January 25, 2024 16:57 — forked from olivierlacan/launch_sublime_from_terminal.markdown
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@zackthehuman
zackthehuman / hexagons.js
Created February 20, 2012 03:46
Drawing a hexagonal grid with HTML canvas
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Canvas Hexagonal Map</title>
<style type="text/css">
canvas {
border:0;
display:block;
margin:0 auto;
@luetkemj
luetkemj / wp-query-ref.php
Last active April 25, 2024 09:37
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active March 27, 2024 06:36
A badass list of frontend development resources I collected over time.
@thebyrd
thebyrd / magicMethod.js
Last active December 19, 2015 05:49
Adds jQuery style getters and setters to a given constructor function.
Function.prototype.method = function (name, func) {
this.prototype[name] = func;
return this;
}
var getParamNames = function (func) {
var funStr = func.toString()
return funStr.slice(funStr.indexOf('(')+1, funStr.indexOf(')')).match(/([^\s,]+)/g)
}
// Make it Nasty
function increment (i) {
i ^= (i & ~-~i) | (~i & -~i)
return i
}
@thebyrd
thebyrd / example.js
Last active December 25, 2015 05:19
A method that will inject npm modules listed as parameters in a constructor.
function SomeConstructor (request, npm, monk) {
// do something with the injected node modules
}
var instance = require('./injector')(SomeConstructor) // create a new instance with dependencies injected
@gaearon
gaearon / slim-redux.js
Last active April 25, 2024 18:19
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {