Skip to content

Instantly share code, notes, and snippets.

View erickreutz's full-sized avatar

Eric Kreutzer erickreutz

View GitHub Profile
@rphlmr
rphlmr / clear-db.ts
Last active April 30, 2024 14:41
Drizzle snippets
// Credits to Louistiti from Drizzle Discord: https://discord.com/channels/1043890932593987624/1130802621750448160/1143083373535973406
import { sql } from "drizzle-orm";
const clearDb = async (): Promise<void> => {
const query = sql<string>`SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'public'
AND table_type = 'BASE TABLE';
`;
@rjsamson
rjsamson / Rakefile
Created May 27, 2013 01:50
Example Rubymotion menubar app
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project/template/osx'
Motion::Project::App.setup do |app|
# Use `rake config' to see complete project settings.
app.name = 'MenubarApp'
app.info_plist['NSUIElement'] = 1
end
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@robhurring
robhurring / README.md
Last active January 30, 2020 19:00
Override devise's TokenAuthenticatable strategy to use Authorization headers

This will allow you to use devise's TokenAuthenticatable strategy while passing your :auth_token in using HTTP Authorization headers instead of params.

You can check it out using

curl -H "Authorization: Token token=XXXXXX, option=1" -vv http://railsapp.dev/api/v1/endpoint.json

It should properly authenticate using the token as well as set request.env['token.options'] to {"options" => "1"}.

@jstn
jstn / JSTN.css
Last active March 1, 2021 02:28
limechat theme
/*
JSTN THEME FOR LIMECHAT 1.0
put this and the other thing in ~/Library/Application Support/LimeChat/Themes/
bg 1a2230
hlight 273146
red e44347
purps 8b84d0
fuscia c2339a
(function(Backbone, _) {
var leave;
_.extend(Backbone.Router.prototype, Backbone.Events, {
route : function(route, name, callback) {
var before
, fn = callback
, after;
Backbone.history || (Backbone.history = new Backbone.History);
@malarkey
malarkey / Contract Killer 3.md
Last active April 16, 2024 21:44
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@jdjkelly
jdjkelly / pitchfork_backbone.js
Created September 20, 2012 14:06
Core Pitchfork Backbone App
// This is the core part of Pitchfork.com's Backbone app.
// The autobahn object in particular is a great example of how to layer backbone on to a traditional, CMS-driven media site while maintaing server-side view rendering.
var p4k = window.p4k || {};
$(function() {
var a = p4k.core = p4k.core || {};
a.Task = function(c, b) {
this.fn = c;
this.initialize(b)
};
{
"auto_indent": true,
"auto_match_enabled": true,
"caret_style": "smooth",
"close_windows_when_empty": true,
"color_scheme": "Packages/Theme - Aqua/Color Schemes/Tomorrow Night Aqua.tmTheme",
"detect_indentation": true,
"dictionary": "Packages/Language - English/en_US.dic",
"draw_centered": false,
"draw_indent_guides": true,
@soffes
soffes / perferences.json
Created August 22, 2012 05:35
My Sublime Text 2 config
{
"bold_folder_labels": true,
"color_scheme": "Packages/User/Espresso Soda.tmTheme",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
".DS_Store",
".gitkeep",
"dump.rdb"
],