Skip to content

Instantly share code, notes, and snippets.

View heliostatic's full-sized avatar

Ben Lee-Cohen heliostatic

View GitHub Profile
@thomaspark
thomaspark / subnav.css
Last active June 6, 2023 10:19
Subnav for Bootstrap 2
section {
padding-top: 60px;
}
.subnav {
margin-bottom: 60px;
width: 100%;
height: 36px;
background-color: #eeeeee; /* Old browsers */
background-repeat: repeat-x; /* Repeat the gradient */
@scottweisman
scottweisman / fade_in.sass
Last active December 11, 2015 09:58
Fade in animation with bourbon and Sass
@-webkit-keyframes fadeIn
from
opacity: 0
to
opacity: 1
@-moz-keyframes fadeIn
from
opacity: 0
to
@ryanb
ryanb / episode_search.rb
Created February 18, 2013 00:44
Class that handles the PostgreSQL full text search for railscasts.com
class EpisodeSearch
attr_reader :ability, :options
delegate :sanitize, to: Episode
def initialize(ability, options = {})
@ability = ability
@options = options.dup
end
def tag
@mrgcohen
mrgcohen / Readme.md
Last active November 9, 2022 22:17
Twitter Bootstrap Typeahead autocomplete example

Requirements

  • bootstrap with typeahead
  • jquery

Explanation

This will use bootstrap with typeahead to create an autocomplete search.

@chmullig
chmullig / lakeMerritt.R
Last active December 14, 2015 16:58
Lake Merritt trash removal graph cleanup
#inspired by: http://www.reddit.com/r/dataisbeautiful/comments/19tgz2/one_of_the_worst_graphs_ive_ever_seen_courtesy_of/
#data from: http://www.lakemerrittinstitute.org/abt_lake_watershed_trash.htm
library(plyr)
library(reshape2)
library(zoo)
library(ggplot2)
library(scales)
df <- read.csv(textConnection("Month,2012,2011,2010,2009,2008,2007,2006,2005,2004,2003,2002,2001,2000,1999,1998,1997
@vitorgalvao
vitorgalvao / Get Title and URL.applescript
Last active May 22, 2024 11:01
AppleScript and JavaScript for Automation to get frontmost tab’s url and title of various browsers.
-- AppleScript --
-- This example is meant as a simple starting point to show how to get the information in the simplest available way.
-- Keep in mind that when asking for a `return` after another, only the first one will be output.
-- This method is as good as its JXA counterpart.
-- Webkit variants include "Safari", "Webkit", "Orion".
-- Specific editions are valid, including "Safari Technology Preview".
-- "Safari" Example:
tell application "Safari" to return name of front document
require "sinatra"
require "google/api_client"
require "data_mapper"
require "twilio-ruby"
require 'rack-ssl-enforcer'
DataMapper::setup(:default, ENV["DATABASE_URL"] || "sqlite3://#{Dir.pwd}/dev.db")
class TokenPair
include DataMapper::Resource
# List of environments and their heroku git remotes
ENVIRONMENTS = {
:staging => 'myapp-staging',
:production => 'myapp-production'
}
namespace :deploy do
ENVIRONMENTS.keys.each do |env|
desc "Deploy to #{env}"
task env do
@afeld
afeld / gist:5704079
Last active November 27, 2023 15:43
Using Rails+Bower on Heroku
@postrational
postrational / gunicorn_start.bash
Last active April 4, 2024 12:48
Example of how to set up Django on Nginx with Gunicorn and supervisordhttp://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
#!/bin/bash
NAME="hello_app" # Name of the application
DJANGODIR=/webapps/hello_django/hello # Django project directory
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket
USER=hello # the user to run as
GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name