Skip to content

Instantly share code, notes, and snippets.

View whatisjasongoldstein's full-sized avatar

Jason Goldstein whatisjasongoldstein

View GitHub Profile
@Vestride
Vestride / encoding-video.md
Last active April 24, 2024 09:59
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@sveinn-steinarsson
sveinn-steinarsson / get_pipeline_urls.py
Created July 14, 2014 12:51
Use django pipeline in Class Media (for example in admin.py)
from django.contrib.staticfiles.storage import staticfiles_storage
from pipeline.packager import Packager
from pipeline.conf import settings
def get_pipeline_urls(package_type, package_name):
packager = Packager()
package = packager.package_for(package_type, package_name)
if settings.PIPELINE_ENABLED:
return ( staticfiles_storage.url(package.output_filename), )
@staltz
staltz / introrx.md
Last active April 25, 2024 04:18
The introduction to Reactive Programming you've been missing
@kara-ryli
kara-ryli / write-sandboxed-html.js
Created June 13, 2012 19:14
Write arbitrary HTML into an iframe sandbox. Useful for untrusted 3rd-party code (e.g. ads).
/**
Writes a sandboxed block of HTML to the supplied node.
<p>Based on an example from <a href="https://github.com/RCanine/embed-code">Meebo</a>.</p>
@method writeSandboxedHTML
@namespace RC
@param {String} width a valid CSS width
@param {String} height a valid CSS height
@param {String} html a block of HTML code
@hosts(["mckenzie.servers.ljworld.com"])
def pull_db(db_name, user_db_name=None):
if db_name is None:
exit("You must provide a database name")
# add username to db_name
if user_db_name is None:
user_db_name = '%s_%s' % (env.user, db_name)
@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
#
@maraujop
maraujop / forms.py
Created February 15, 2012 19:04
django-crispy-forms bootstrap form example
# -*- coding: utf-8 -*-
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions
class MessageForm(forms.Form):
text_input = forms.CharField()
@neilj
neilj / gist:1532562
Created December 29, 2011 07:22
Sugared DOM: Better Than Templates
var el = ( function () {
var doc = document;
var directProperties = {
'class': 'className',
className: 'className',
defaultValue: 'defaultValue',
'for': 'htmlFor',
html: 'innerHTML',