Skip to content

Instantly share code, notes, and snippets.

@jnewland
jnewland / .caprc
Created August 21, 2010 17:44
toss this in your ~/.caprc, then `cap cowboy staging deploy`. Use carefully.
namespace :cowboy do
desc 'Deploy without SCM'
task :default do
deploy_stage = fetch(:stage, 'none')
set :repository, "."
set :deploy_via, :copy
set :scm, :none
set :stage, deploy_stage
set :cowboy_deploy, true
set :copy_exclude, [".git/*", ".svn/*", "log/*", "vendor/bundle/*"]
@amejiarosario
amejiarosario / rails_migration_cheatsheet.md
Created June 18, 2012 21:40
Rails Migration - Cheatsheet
@matheusoliveira
matheusoliveira / json_manipulator.sql
Last active February 17, 2024 15:14
Simple PostgreSQL functions to manipulate json objects. (Note: performance is not a concern for those functions)
CREATE OR REPLACE FUNCTION public.json_append(data json, insert_data json)
RETURNS json
IMMUTABLE
LANGUAGE sql
AS $$
SELECT ('{'||string_agg(to_json(key)||':'||value, ',')||'}')::json
FROM (
SELECT * FROM json_each(data)
UNION ALL
SELECT * FROM json_each(insert_data)
import { EditorState, Modifier, Entity, SelectionState } from 'draft-js'
import linkifyIt from 'linkify-it'
import tlds from 'tlds'
const linkify = linkifyIt()
linkify.tlds(tlds)
const linkifyEditorState = (editorState) => {
const contentState = editorState.getCurrentContent()
import { EditorState, Modifier, Entity, SelectionState } from 'draft-js'
import linkifyIt from 'linkify-it'
import tlds from 'tlds'
const linkify = linkifyIt()
linkify.tlds(tlds)
const linkifyEditorState = (editorState) => {
const contentState = editorState.getCurrentContent()
@mrmartineau
mrmartineau / stimulus.md
Last active May 12, 2024 04:35
Stimulus cheatsheet
@cvan
cvan / debug-tailwind.md
Created February 16, 2023 04:55
debug tailwind

show me all the Tailwind CSS classes to use in my project

which CSS selectors to use? this shows all the (non-dynamic) options generated from your project's tailwind.config.js.

rogden/tailwind-config-viewer is the best. run from the command line:

npx tailwind-config-viewer -o