Skip to content

Instantly share code, notes, and snippets.

@punkstar
punkstar / build_jekyll.sh
Created March 21, 2014 08:32
DeployHQ steps to deploy a jekyll site
# We build everything in a staging directory, so we don't take the site down during a deployment.
rm -rf %path%/../staging/ && mkdir %path%/../staging/
# Perform the actual jekyll build, constants are for encoding issues (I think, can't remember)
source ~/.bashrc && cd %path% && LC_CTYPE=en_US.UTF-8 LANG=en_US.UTF-8 jekyll
# Build the sass files, so we don't need to keep the css in our repo
source ~/.bashrc && cd %path%/../staging/ && LC_CTYPE=en_US.UTF-8 LANG=en_US.UTF-8 && sass --update .
# Copy our .htaccess across
@JustAdam
JustAdam / drupal_taxonomy_content_type.php
Created August 2, 2012 09:49
Drupal 7 - Programmatically create a taxonomy and attach a field to it, then create a content type and attach that taxonomy to it.
<?php
// Machine name for our custom node
define('NODE_NAME', 'the_node_machine_name');
// Machine name for our custom taxonomy
define('TAXONOMY_NAME', 'the_taxonomy_machine_name');
function module_install() {
_create_taxonomy();
_create_content_type();
}
@alotaiba
alotaiba / google_speech2text.md
Created February 3, 2012 13:20
Google Speech To Text API

Google Speech To Text API

Base URL: https://www.google.com/speech-api/v1/recognize
It accepts POST requests with voice file encoded in FLAC format, and query parameters for control.

Query Parameters

client
The client's name you're connecting from. For spoofing purposes, let's use chromium

lang
Speech language, for example, ar-QA for Qatari Arabic, or en-US for U.S. English