Skip to content

Instantly share code, notes, and snippets.

View gregoriokusowski's full-sized avatar

Gregório Chalinski Kusowski gregoriokusowski

View GitHub Profile
@burke
burke / remotepaste.md
Last active November 10, 2025 16:09
This sets up keybindings in tmux that allow you to copy/paste to/from your OS X clipboard from tmux running inside an SSH connection to a remote host. Partially borrowed from http://seancoates.com/blogs/remote-pbcopy

Local (OS X) Side

~/Library/LaunchAgents/pbcopy.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
     <key>Label</key>
     <string>localhost.pbcopy</string>
@schickling
schickling / Rakefile
Last active January 30, 2026 04:45
Activerecord without Rails
require "active_record"
namespace :db do
db_config = YAML::load(File.open('config/database.yml'))
db_config_admin = db_config.merge({'database' => 'postgres', 'schema_search_path' => 'public'})
desc "Create the database"
task :create do
ActiveRecord::Base.establish_connection(db_config_admin)
@rponte
rponte / configure_mysql-server.sh
Last active August 19, 2023 05:06
Script bash to configure a simple MySQL server environment
#!/bin/bash
###############################
# MySQL Server dependencies #
###############################
# The latest source code can be found at https://gist.github.com/rponte/7561856
set -e # Exit script immediately on first error.
#set -x # Print commands and their arguments as they are executed.
@ftrain
ftrain / rhymes.clj
Last active July 14, 2023 22:20
Annotated rhyming dictionary
;; This is at: https://gist.github.com/8655399
;; So we want a rhyming dictionary in Clojure. Jack Rusher put up
;; this code here:
;;
;; https://gist.github.com/jackrusher/8640437
;;
;; I'm going to study this code and learn as I go.
;;
;; First I put it in a namespace.
@Kartones
Kartones / postgres-cheatsheet.md
Last active May 12, 2026 17:29
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@sebmarkbage
sebmarkbage / react-terminology.md
Last active January 11, 2026 02:45
React (Virtual) DOM Terminology
@nicolasembleton
nicolasembleton / restart_bluetooth.sh
Last active March 13, 2026 16:50
Restart Bluetooth Daemon on Mac OS X without restarting
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
@pbalduino
pbalduino / thread-macro.clj
Last active August 29, 2015 14:22
-> e ->>
(defn minha-funcao [a b]
(println "a =" a "- b=" b))
(-> "valor"
(minha-funcao "outro"))
; a = valor - b= outro
(->> "valor"
(minha-funcao "outro"))
; a = outro - b= valor