This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
<?php | |
trait MetaClass | |
{ | |
protected $__classMethods = array(); | |
static protected $__staticMethods = array(); | |
public function __call($name, $args) | |
{ |
require "openssl" | |
require "digest" | |
def aes128_encrypt(key, data) | |
key = Digest::MD5.digest(key) if(key.kind_of?(String) && 16 != key.bytesize) | |
aes = OpenSSL::Cipher.new('AES-128-CBC') | |
aes.encrypt | |
aes.key = key | |
aes.update(data) + aes.final | |
end |
#!/usr/bin/ruby | |
=begin | |
Planter v1.3 | |
Brett Terpstra 2013 | |
ruby script to create a directory structure from indented data. | |
Three ways to use it: | |
- Pipe indented (tabs or 2 spaces) text to the script | |
- e.g. `cat "mytemplate" | planter.rb | |
- Create template.tpl files in ~/.planter and call them by their base name |
<?php | |
/** | |
* Get first paragraph from a WordPress post. Use inside the Loop. | |
* | |
* @return string | |
*/ | |
function get_first_paragraph(){ | |
global $post; | |
$str = wpautop( get_the_content() ); |
/* | |
* Using Sass's @each loop to automatically generate code for web fonts | |
*/ | |
$fonts: (vpm, font-awesome); | |
@each $font in $fonts { | |
@include font-face( $font, | |
font-files( | |
'#{$font}/#{$font}.woff', |
# get the name of your theme folder | |
WP_THEME_FOLDER = File.basename(File.dirname(__FILE__)) | |
# best path for assets in Wordpress project | |
http_path = "/wp-content/themes/#{WP_THEME_FOLDER}/" | |
css_dir = "." | |
sass_dir = "sass" | |
images_dir = "img" | |
javascripts_dir = "js" | |
fonts_dir = "fonts" |
require 'benchmark' | |
# | |
# Code example for my blogpost | |
# | |
# Hash lookup in Ruby, why is it so fast? | |
# | |
# | |
# Struct used to store Hash Entries |
// A named buffer. Will append to existing content captured there. | |
// The buffer can be accessed via get-capture("foo") or @emit "foo". | |
@capture "foo" { | |
@media screen { | |
.asdf { | |
.qwerty { | |
/* This is a comment */ | |
color: red; | |
} | |
} |
This Gist has been moved to https://github.com/lbgists/rain.sh.