Skip to content

Instantly share code, notes, and snippets.

@ProximaMonkey
ProximaMonkey / nginx.conf
Created April 16, 2012 01:44 — forked from dmdeller/nginx.conf
DuckDuckGo nginx config for handling Safari search bar requests
server {
server_name search.yahoo.com;
# only handle requests from Safari search bar
if ($args ~ fr=aaplw.*p=) {
rewrite ^/search https://duckduckgo.com/?q=$arg_p? break;
}
# attempt to redirect other requests back to Yahoo, using alternative server name
rewrite ^ http://search.ystg1.b.yahoo.com$request_uri? break;
@ProximaMonkey
ProximaMonkey / mysql.py
Created April 16, 2012 00:13 — forked from adamv/mysql.py
Simple wrapper around MySQLdb
import collections
import MySQLdb as dbapi
__all__ = ['MySql']
class MySql(object):
def __init__(self, **kwargs):
self.connection = dbapi.connect(**kwargs)
self.host_name = kwargs.get('host')
@ProximaMonkey
ProximaMonkey / webdev.md
Created April 14, 2012 02:03 — forked from dideler/bootstrapping.md
Bootstrapping
@ProximaMonkey
ProximaMonkey / foo
Created April 14, 2012 01:51
I hate Internet Explorer
function(container, pins) {
pins.imagesLoaded(function(images){
container.masonry('appended', pins, false);
// IE fix preventing not loading images
jQuery.each(images, function(i, e, c) {
var tmp_src = jQuery(e).attr("src");
if (!e.complete) {
jQuery(e).attr("src", "");
jQuery(e).attr("src", tmp_src);
@ProximaMonkey
ProximaMonkey / README.markdown
Created April 13, 2012 11:06 — forked from gudbergur/README.markdown
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string
@ProximaMonkey
ProximaMonkey / remote-typeahead.js
Created April 13, 2012 11:05 — forked from geuis/remote-typeahead.js
Remote data querying for Twitter Bootstrap 2.0 Typeahead without modifications
<script>
// Charles Lawrence - Feb 16, 2012. Free to use and modify. Please attribute back to @geuis if you find this useful
// Twitter Bootstrap Typeahead doesn't support remote data querying. This is an expected feature in the future. In the meantime, others have submitted patches to the core bootstrap component that allow it.
// The following will allow remote autocompletes *without* modifying any officially released core code.
// If others find ways to improve this, please share.
var autocomplete = $('#searchinput').typeahead()
.on('keyup', function(ev){
ev.stopPropagation();
@ProximaMonkey
ProximaMonkey / gist:2374918
Created April 13, 2012 07:40 — forked from cdragos/gist:2299991
Bootstrap jQuery plugin for creating confirmation dialogs with deferred chainable callbacks and Mustache templates.
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet" />
<title>Bootstrap modal confirm</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
@ProximaMonkey
ProximaMonkey / log.html
Created April 13, 2012 07:38 — forked from pamelafox/log.html
Jinja2 Template Example (Everyday.io Log)
{% extends "yourbase.html" %}
{% block subheader %}
<div class="page-header">
<h1>
<span id="log-date">{{ title }}</span>
<a data-tooltip="Change the date" id="log-date-button" href="javascript:void(0);" style="margin-left: 10px;"><img src="img/calendar.png"></a>
</h1>
</div>
{% endblock %}
@ProximaMonkey
ProximaMonkey / letter_renderer.py
Created April 13, 2012 07:37
Jinja2 letter template example
#!/usr/bin/env python
#encoding=utf-8
"""
Seth Brown
Python 3.2
Blog post link: http://j.mp/H5Zrdn
"""
import os, sys, csv
from glob import iglob
from subprocess import Popen, PIPE
@ProximaMonkey
ProximaMonkey / phonegap.html
Created April 13, 2012 07:34 — forked from pamelafox/phonegap.html
Phonegap Index (Jinja2)
<!doctype html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>everyday.io</title>
{% if g and g.debug %}
<link rel="stylesheet" href="css/colorslider.css" />
<link rel="stylesheet" href="css/dateinput.css" />
<link rel="stylesheet" href="css/bootstrap-1.3.0.min.css">