Skip to content

Instantly share code, notes, and snippets.

View RyanParsley's full-sized avatar

Ryan Parsley RyanParsley

View GitHub Profile
require 'rubygems'
require 'sinatra'
require 'haml'
get '/' do
haml :index, :layout => false #=> Don't use layout.haml.
end
get '/about' do
haml :about, :layout => 'layout2' #=> Use layout2.haml.
@walkah
walkah / drupal.rb
Created January 4, 2012 05:24
Drupal7 to Jekyll converter
require 'rubygems'
require 'sequel'
require 'fileutils'
require 'yaml'
# NOTE: This converter requires Sequel and the MySQL gems.
# The MySQL gem can be difficult to install on OS X. Once you have MySQL
# installed, running the following commands should work:
# $ sudo gem install sequel
# $ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
@owainlewis
owainlewis / _analytics.haml
Created March 9, 2012 20:06
Google Analytics HAML
:javascript
var _gaq = _gaq || [];
_gaq.push(['_setAccount', YOUR_CODE']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@jschementi
jschementi / README.md
Created April 29, 2012 23:56
Trello to Todo.txt converter
@SeanJA
SeanJA / 1.json
Created June 18, 2012 04:17
a simple json file migration for the drupal 7 (maybe 6?) migrate module
{
"title": "this is a title",
"content": "this is a body",
"date": "2009-01-01",
"url":"http://oldsite.com/123/test",
"image": "test.jpg",
"id": 1
}
@tdpreece
tdpreece / simple_http_server.sh
Created September 25, 2015 16:38
Running a Python SimpleHTTPServer in the background and killing it when doneSimpleHTTPServer
#!/usr/bin/env bash
# Create a page in the current dir
echo "My Test Page" > test.html
# Start server
python -m SimpleHTTPServer 8000 &> /dev/null &
pid=$!
# Give server time to start up
@tarfu
tarfu / pico_pwm_hal.rs
Created April 2, 2024 14:31
Crude embassy-rp pwm HAL abstraction
use core::convert::Infallible;
use embassy_rp::pwm::{Channel, Config, Pwm};
use embedded_hal::pwm::{ErrorType, SetDutyCycle};
pub struct PwmChannelB<'d, T: Channel> {
pwm: Pwm<'d, T>,
config: Config,
max_is_logical_one: bool
}