Skip to content

Instantly share code, notes, and snippets.

View lukeholder's full-sized avatar
👋

Luke Holder lukeholder

👋
View GitHub Profile
@lukeholder
lukeholder / composer.json
Last active December 15, 2015 17:59
twig in silex
{
"require": {
"silex/silex": "1.0.*@dev",
"twig/twig": ">=1.8,<2.0-dev",
"symfony/twig-bridge": "~2.1",
"monolog/monolog": ">=1.0.0"
}
}
@lukeholder
lukeholder / anonymous.js
Last active December 16, 2015 07:49 — forked from anonymous/anonymous.js
This script redirects all the links via blankrefer.com - except for the sites that were included in the protected_links string
//This script redirects all the links via blankrefer.com - except for the sites that were included in the protected_links string
//Example:
//var protected_links = "myspace,ebay";
var protected_links = "";
var a_to_va = 0;
var a_to_vb = 0;
var a_to_vc = "";
function blank_refer()
{
@lukeholder
lukeholder / migrate.rb
Created May 27, 2013 10:20
ruby script to get at a wordpress export and put it into a sqlite db
#!/bin/env ruby
# encoding: utf-8
require 'rubygems'
require 'bundler/setup'
# require your gems as usual
require 'sequel'
require 'nokogiri'
require 'time'
@lukeholder
lukeholder / all.rb
Created May 27, 2013 13:33
all images
all_images = Nokogiri.parse(body).css('a[href]').map { |a| a[:href] }.grep(/\.(?:png|jpg)\z/i)
all_images << Nokogiri.parse(body).css('img[src]').map { |a| a[:src] }.grep(/\.(?:png|jpg)\z/i)
@lukeholder
lukeholder / ios.html
Created May 28, 2013 03:43
diable copy paste
<style type="text/css">
*:not(input,textarea) {
-webkit-touch-callout: none;
-webkit-user-select: none; /* Disable selection/Copy of UIWebView */
}
</style>
@lukeholder
lukeholder / wiki.go
Created May 28, 2013 09:07
wiki in go with markdown
// Copyright 2013 Luke Holder. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"github.com/russross/blackfriday"
"io/ioutil"
"net/http"
@lukeholder
lukeholder / nav.twig
Last active June 20, 2018 16:53
nested navigation with in template variables.
{% set nav = [
{"href": "http://1.com", "name": "link1","sublinks":null},
{"href": "http://1.com", "name": "link2","sublinks":null},
{"href": "http://1.com", "name": "link3","sublinks":
[{"href": "http://1.com", "name": "link 3.11","sublinks":null},
{"href": "http://1.com", "name": "link 3.22","sublinks":
[{"href": "http://1.com", "name": "link 3.11","sublinks":null},
{"href": "http://1.com", "name": "link 3.22","sublinks":null}
]
}]
@lukeholder
lukeholder / install.md
Last active December 18, 2015 06:09
instructions for episode 0001 of learning your craft.

Setup your Digital Ocean droplet.

your machine:

ssh root@IP-ADDRESS

on the server:

passwd

@lukeholder
lukeholder / html.html
Created June 11, 2013 15:05
html.html
<div class="navi-live">
<ol ui-nested-sortable="{
listType: 'ol',
items: 'li',
doNotClear: true,
placeholder: 'ui-state-highlight',
forcePlaceholderSize: true,
toleranceElement: '&gt; div'
}" ui-nested-sortable-stop="update($event, $ui)" class="navi-item-container ui-sortable"><li ya-tree="child in data.children at ol" ng-class="{minimized:child.minimized}" class="navi-item ng-scope" ng-style="getStyle(child)" style="font-weight: bold;">
<div class="nav-item-contents">
@lukeholder
lukeholder / _entry.html
Last active December 19, 2015 06:59
craft entry form
<form method="post" action="" accept-charset="UTF-8">
<input type="hidden" name="action" value="entries/saveEntry">
<input type="hidden" name="redirect" value="blog/{{ entry.slug }}">
<input type="hidden" name="entryId" value="{{ entry.id }}">
<input type="hidden" name="sectionId" value="1">
<input type="hidden" name="slug" value="{{ entry.slug }}">
<input type="hidden" name="enabled" value="1">
<label for="title">Title</label>
<input id="title" type="text" name="title" value="{{ entry.title }}">