Skip to content

Instantly share code, notes, and snippets.

View bensternthal's full-sized avatar
😻

Benjamin Sternthal bensternthal

😻
View GitHub Profile
@bensternthal
bensternthal / gist:5448568
Created April 24, 2013 00:14
share on modal
// Close modal on clicking close button or background.
$document.on('click', '#modal .close', flicks.closeModal);
//$document.on('click', '#modal.bg_close', flicks.closeModal);
$(function() {
/* Share Widget *******/
var $share = $('.share');
var $popup = $share.find('.popup');
@bensternthal
bensternthal / dirtocsv.py
Last active December 19, 2015 02:49
Re-writing a bash script Justin wrote in python.
import csv
import os
from os.path import join, getsize
ROOTURL = 'http://www.mozilla.org'
ROOTSVN = 'http://viewvc.svn.mozilla.org/vc/projects/mozilla.org/trunk'
with open('test.csv', 'wb') as csvfile:
csvwriter = csv.writer(csvfile, delimiter=',',
quotechar='|', quoting=csv.QUOTE_MINIMAL)
{# L10n: Text is used in a tweet, please keep the length under 110 characters. #}
<a href="{{ twitterShare('http://mzl.la/158wtFo', _('Vote for the #FirefoxFlicks People\'s Choice Award! ') , via='firefoxflicks') }}" rel="external" data-window-opts="toolbar=0, status=0, resizable=1, width=626, height=436">
{{ _('Share on Twitter') }}
</a>
@bensternthal
bensternthal / gist:7548331
Created November 19, 2013 16:39
Apache Static Files
from django.conf import settings
from django.conf.urls.defaults import include, patterns
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns <- this!!
from django.http import HttpResponse
from django.shortcuts import render
***
How has working with your manager been this last quarter?
What are the things your manager does really well?
What are the things your manager could improve?
Within Web Productions, what could your manager do to make you or our team more effective.
In the larger Mozilla universe, what would you like to see your manager work to improve?
@bensternthal
bensternthal / js-bug-id-regex
Created February 21, 2014 18:15
I want to get the list of bugs mentioned in a commit message! Essentially the same regex used here but in Javasctipt: https://github.com/github/github-services/blob/master/lib/services/bugzilla.rb#L139
//I hate regex. Here is what I have so far.
var testString = "fix bug 3524";
var regex1 = new RegExp("/(?:close|fix|address)*?(?=(?:ticket|bug|tracker item|issue)*?)/","i");
var result = regex1.exec(testString);
if (result) {
console.log(result);
} else {
console.log('no match!');
@bensternthal
bensternthal / gist:9238814
Created February 26, 2014 21:20
Git Config For Pretty Log "git lg"
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit"
THE FOLLOWING PACKAGES DIDN'T MATCHES THE HASHES SPECIFIED IN THE REQUIREMENTS
FILE. If you have updated the package versions, update the hashes. If not,
freak out, because someone has tampered with the packages.
django-appconf: expected 53T3tTehlADKaH9I01KrdGFzKsQThd2I_a1Hie-tKcU
got qI7Y-5I6U8cMLEb75FCLX4Fka0sBQB8VaKghZxszIVw
six: expected jzT1uJ4X-opuOUUxAxjL1cjLsW-iiPeOqW28cDRMsb8
got 1DkqfI2RsAXAAlaKhfr2F8ZyQcjNg5nMOV6PEAWv-A0
Django: expected uBCR_UHpUunXFQuLwgVbFAwsETJIX3jk6gdQE3CAANU
got 0bP4Rg6Tb0eEbnxPgK-VHtqCpBwlPDpR_zOJhj_xwDo
@bensternthal
bensternthal / index.html
Last active August 29, 2015 14:02
D3 Experiment #1
<!DOCTYPE html>
<meta charset="utf-8">
<style>
</style>
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>