Skip to content

Instantly share code, notes, and snippets.

@chrisyour
chrisyour / Folder Preferences
Created December 4, 2010 20:05
Show hidden files and hidden folders (except .git) in your TextMate project drawer
# Want to show hidden files and folders in your TextMate project drawer? Simple, just modify the file and folder patterns in TextMate's preferences.
# Instructions:
# Go to TextMate > Preferences...
# Click Advanced
# Select Folder References
# Replace the following:
# File Pattern
@jrochkind
jrochkind / gist:2161449
Created March 22, 2012 18:40
A Capistrano Rails Guide

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

@tobyhede
tobyhede / postsql.sql
Created May 17, 2012 03:08
PostgreSQL as JSON Document Store
-- PostgreSQL 9.2 beta (for the new JSON datatype)
-- You can actually use an earlier version and a TEXT type too
-- PL/V8 http://code.google.com/p/plv8js/wiki/PLV8
-- Inspired by
-- http://people.planetpostgresql.org/andrew/index.php?/archives/249-Using-PLV8-to-index-JSON.html
-- http://ssql-pgaustin.herokuapp.com/#1
-- JSON Types need to be mapped into corresponding PG types
--
@stuarthalloway
stuarthalloway / Datomic News Updates
Created June 18, 2012 14:53
Datomic update examples against a social news database
;; Datomic example code
;; demonstrates various update scenarios, using a news database
;; that contains stories, users, and upvotes
;; grab an in memory database
(use '[datomic.api :only (q db) :as d])
(def uri "datomic:mem://foo")
(d/create-database uri)
(def conn (d/connect uri))
@webgio
webgio / app.coffee
Last active December 10, 2023 10:24
Marionette.js module to manage authentication. Needs a server method that checks credentials returning true or false. Started from this blog post code: http://clintberry.com/2012/backbone-js-apps-authentication-tutorial/
App = new Marionette.Application();
App.addRegions {
"headerRegion": "#header"
"topMenuRegion": "#top-menu"
"mainRegion" : "#main"
}
App.on 'initialize:after', ->
Backbone.history.start()
@kyledrake
kyledrake / ferengi-plan.txt
Last active April 6, 2024 00:30
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@Deraen
Deraen / components.clj
Last active December 15, 2019 08:03
Compojure-api with Component
(ns foobar.components
(:require [com.stuartsierra.component :as component]
[compojure.api.sweet :refer :all]))
(defmethod compojure.api.meta/restructure-param :components
[_ components acc]
(update-in acc [:letks] into [components `(::components ~'+compojure-api-request+)]))
(defn wrap-components [handler components]
(fn [req]
@kanaka
kanaka / gist:728961ce861c81a11bc6
Last active August 29, 2015 14:23
cljs-bootstrap crib sheet
# Step-by-step distilled from: https://github.com/swannodette/cljs-bootstrap
git clone https://github.com/clojure/clojurescript
git clone https://github.com/swannodette/cljs-bootstrap
#git clone https://github.com/clojure/tools.reader
git clone https://github.com/swannodette/tools.reader
cd clojurescript/
./script/build
Sample .NET Core + Npgsql for RC2
1] Project.json
{
"buildOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Npgsql": "3.1.0"