Skip to content

Instantly share code, notes, and snippets.

View Dahie's full-sized avatar

Daniel Senff Dahie

View GitHub Profile
@somebox
somebox / convert_trac.rb
Created October 10, 2010 20:31
Convert Trac Wiki to Markdown
#!/usr/bin/env ruby
# Convert Trac DB Wiki pages to Markdown source files
# This script is based on http://github.com/seven1m/trac_wiki_to_github which
# converted all pages from a Trac DB to GitHub Wiki format (as Textile).
#
# I made two changes:
# - uses MarkDown format instead
# - uses the sqllite3-ruby gem which does not need Ruby 1.9
#!/usr/bin/env sh
# Watch Al Jazeera live stream with mplayer. You can specify the
# quality as argument by passing either "low", "high" or "veryhigh"
# to the script. If nothing is given it defaults to "veryhigh".
function printUsage() {
echo "Please pass no arguments or either \"low\", \"high\" or \"veryhigh\". No arguments defaults to \"veryhigh\"."
}
# default quality
@nocksock
nocksock / deploy.rb
Created December 7, 2011 16:06
Capistrano Drupal(6) Deployment Recipe
#
# Capistrano recipe for deploying Drupal7 using git and ssh.
#
# Part of the explanations in the comments taken from:
# http://help.github.com/deploy-with-capistrano/
#
set :default_environment, {
# This is the $PATH for the deploymant shell. using uberpsace's recent php
# and added ~/bin for drush.
@panayi
panayi / gist:2781592
Created May 24, 2012 13:38
Ember.js: Animating view with JQ.Animation mixin
JQ.Animate = Ember.Mixin.create({
cssProperties: ['background', 'backgroundAttachment', 'backgroundColor', 'backgroundImage', 'backgroundPosition',
'backgroundRepeat', 'border', 'borderBottom', 'borderBottomColor', 'borderBottomStyle', 'borderBottomWidth',
'borderColor', 'borderLeft', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRight', 'borderRightColor',
'borderRightStyle', 'borderRightWidth', 'borderStyle', 'borderTop', 'borderTopColor', 'borderTopStyle', 'borderTopWidth',
'borderWidth', 'clear', 'clip', 'color', 'cursor', 'display', 'filter', 'font', 'fontFamily', 'fontSize',
'fontVariant', 'fontWeight', 'height', 'left', 'letterSpacing', 'lineHeight', 'listStyle', 'listStyleImage',
'listStylePosition', 'listStyleType', 'margin', 'marginBottom', 'marginLeft', 'marginRight', 'marginTop', 'overflow',
'padding', 'paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop', 'pageBreakAfter', 'pageBreakBefore',
'position', 'styleFloat', 'textAlign', 'textDecoration'
@mminer
mminer / pocket.py
Created July 27, 2012 06:45
A script to save URLs to Pocket (read it later service).
#!/usr/bin/env python
"""
Saves URL(s) to a user's Pocket queue.
It accepts either command line arguments or a URL from the OS X clipboard.
For information about Pocket see http://getpocket.com/
"""
import optparse
import subprocess
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
import json
import os
import csv
API_URL = "http://wiki.piratenbrandenburg.de/api.php"
# remove content and applicaions_list manually
CATEGORIES = ["Kategorie:Landesparteitag_2013.2_Satzungsänderungsantrag",
@atenni
atenni / README.md
Last active July 20, 2024 05:49
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

@leobossmann
leobossmann / clone shopify checkout locale
Last active November 7, 2017 18:26
Shamelessly copy a checkout translation in the Shopify backend.
When logged in, go to "Settings > Checkout > Checkout Language", click the "View and customize this translation" link.
A page with a url like this opens: "https://yourshop.myshopify.com/admin/settings/locales/[locale_id]".
copy [locale_id].
Go Back and choose "create a new one".
Open the Javascript console, paste this (change to your shop/locale_id first):
@romanlehnert
romanlehnert / gist:6522520
Created September 11, 2013 11:51
measuring delayed_job speed
def current_job_speed(time = 5)
start_time = Time.now
start_count = Delayed::Job.count
sleep time
end_time = Time.now
end_count = Delayed::Job.count
t = end_time - start_time
@anikalindtner
anikalindtner / gist:9524950
Last active March 1, 2023 11:52
Workshops/Mailinglists/Lists