Skip to content

Instantly share code, notes, and snippets.

View DarrenN's full-sized avatar
🌵
(on-a vision-quest)

Darren DarrenN

🌵
(on-a vision-quest)
View GitHub Profile
@deltamualpha
deltamualpha / gist:614e1799f97c8be298f8
Last active August 29, 2015 14:06
php phar download puppet
# install a phar file from a remote server directly
define php::phar ($url, $insecure = false, $target = $title) {
$split = split($url, '/')
$filename = $split[-1]
# for wget bug workarounds
if ($insecure == true) {
$wget_options = "--no-check-certificate"
}
@deltamualpha
deltamualpha / gist:c3a191260352f24eb74e
Created September 6, 2014 21:21
create a proper extension file for an installed php module
define php::conf {
if $::lsbdistcodename == 'precise' {
$php_build = '20090626'
file { "/etc/php5/conf.d/${title}.ini":
ensure => present,
owner => 'root',
group => 'root',
mode => '0644',
content => template("php/conf.d/${title}.ini"),
// ==UserScript==
// @name Export Github Issues
// @namespace http://userscripts.org/users/tim
// @description Can export issues by state and label
// @include http://github.com/*/issues*
// ==/UserScript==
(function() {
var GITHUB_API_URL, GithubRequest, URL_EXPRESSION, formatOutput, menuCallback, repo, url, user;
URL_EXPRESSION = /^.*\/(.*?)\/(.*?)\/issues.*$/;
GITHUB_API_URL = 'http://github.com/api/v2/json';
@cowboy
cowboy / textmate_grammar-html_syntaxhighlighter_pre_brush
Created October 7, 2010 17:55
TextMate + Zen Coding + SyntaxHighlighter + this = yay
{ name = 'source.css.embedded.html.syntaxhighlighter';
begin = '(?:^\s+)?(<)((?i:pre))\b(?=[^>]*class=([''"])[^>]*?\bbrush\s*:\s*css\b[^>]*?\3)(?![^>]*/>)';
end = '(?<=</(pre|PRE))(>)(?:\s*\n)?';
beginCaptures = {
1 = { name = 'punctuation.definition.tag.html'; };
2 = { name = 'entity.name.tag.style.html'; };
};
endCaptures = { 2 = { name = 'punctuation.definition.tag.html'; }; };
patterns = (
{ include = '#tag-stuff'; },
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>bundleUUID</key>
<string>A9237092-D694-450A-8C8F-F9005D932664</string>
<key>command</key>
<string>osascript -e 'tell application "Safari" to set theSource to do JavaScript "window.document.documentElement.outerHTML" in document 1'</string>
@ggilder
ggilder / TextMate_scriptmate_fix.rb
Created November 3, 2010 22:35
Fix TextMate's scriptmate.rb to work with Ruby 1.9
# located at /Applications/TextMate.app/Contents/SharedSupport/Support/lib/scriptmate.rb
# change lines 12 - 13:
$KCODE = 'u' if (RUBY_VERSION.to_f < 1.9)
require "jcode" unless "".respond_to? :each_char
# rest of the file is unchanged
@seancribbs
seancribbs / test_server.coffee
Created January 7, 2011 18:00
WIP port of Ripple's Riak::TestServer to riak-js
$ node ts.js
10 Jan 15:01:23 - prepared
10 Jan 15:01:24 - started
PUT /riak/airlines/KLM
10 Jan 15:01:24 - saved
10 Jan 15:01:24 - cleared
GET /riak/airlines/KLM
10 Jan 15:01:24 - not found! it works
require 'coffee-script'
desc "compile coffee-scripts from ./src to ./public/views"
task :coffee do
source = "#{File.dirname(__FILE__)}/src/"
javascripts = "#{File.dirname(__FILE__)}/public/javascripts/"
Dir.foreach(source) do |cf|
unless cf == '.' || cf == '..'
js = CoffeeScript.compile File.read("#{source}#{cf}")
@zzak
zzak / gist:830035
Created February 16, 2011 19:49
define_method hello, world!
def add_method(obj, mod, &blk)
obj.class_eval { define_method(mod, &blk) }
end
add_method(String, :greet) { "Hello, #{self}" }
"world".greet #=> "Hello, world!"
@chriseppstein
chriseppstein / pending_blog_posts.markdown
Created March 30, 2011 22:27
A list of blog posts that I should write.
  • Mini state machines for page state with sass/jquery and html or body classes.
  • double-layer color constants: layer one: color names ($olive-green), layer two: common uses of colors ($link-color).