Skip to content

Instantly share code, notes, and snippets.

@Kartones
Kartones / postgres-cheatsheet.md
Last active July 22, 2026 14:06
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)

React Native Newsletter - Community Interview #1

Chirag Jain (twitter) (github) is the cofounder of Lrn, a React Native iOS app released to the app store on July 28th that jumped to the top of ProductHunt in the same day. It was also reported on by Creator,

@marquisthunder
marquisthunder / tmux.conf
Last active August 28, 2025 22:41
[tmux]tmux defaultconf #tmux
set-option -g mouse-select-pane on
set-window-option -g mode-mouse on
set -g prefix C-a
unbind C-b
bind r source-file ~/.tmux.conf \; display "Reloaded!"
bind | split-window -h
bind - split-window -v
# moving between panes
bind h select-pane -L
bind j select-pane -D
@mankind
mankind / rails-jsonb-queries
Last active March 30, 2026 13:03
Ruby on Rails-5 postgresql-9.6 jsonb queries
http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query
http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails
#payload: [{"kind"=>"person"}]
Segment.where("payload @> ?", [{kind: "person"}].to_json)
#data: {"interest"=>["music", "movies", "programming"]}
Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json)
Segment.where("data #>> '{interest, 1}' = 'movies' ")
Segment.where("jsonb_array_length(data->'interest') > 1")
@wbotelhos
wbotelhos / clear-sidekiq-jobs.sh
Last active February 24, 2026 08:35
Clear Sidekiq Jobs
require 'sidekiq/api'
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear
@mrmartineau
mrmartineau / stimulus.md
Last active April 25, 2026 07:43
Stimulus cheatsheet
@MarkWalters-dev
MarkWalters-dev / weightgurus.py
Last active October 24, 2023 21:29
Access data collected by your Greater Goods Weight Gurus scale
#!/usr/bin/env python3
# So I asked Greater Goods if they would point me in the direction of their API. So I could get data
# from their WiFi scale without the limitations of their Weight Gurus app. They said they don't give
# that out. So my options are to return the scale to Amazon because it is useless to me without an
# API or I figure it out myself. Anyway, I figured it out so you don't have to return your scale.
# This isn't an API but from here you can atleast access the data.
# If you don't already have the scale you can find it on Amazon
# UPC 875011003964
@ridget
ridget / graphql_tips.md
Last active August 1, 2021 05:11
Useful GraphQL Schema Design Links
@dottedsquirrel
dottedsquirrel / Code.gs
Last active February 9, 2025 11:45
Code.gs - Spreedsheet to Magic API
/**
* Copyright 2019 Google LLC.
* SPDX-License-Identifier: Apache-2.0
*/
function getEnvironment() {
var environment = {
spreadsheetID: "<REPLACE WITH YOUR SPREADSHEET ID>",
firebaseUrl: "<REPLACE WITH YOUR REALTIME DB URL>"
};
# This should be triggered through a cron job at 6:15 PM on week days.
# Example cron: 15 18 * * 1,2,3,4,5 cd ~/code/jury_duty && ~/.rbenv/shims/ruby call.rb >> ~/code/jury_duty/call-log.txt 2>&1
# It uses Twilio to make a call based on TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, and TWILIO_PHONE.
# It calls the JURY_PHONE, transcribes it, looks for JURER_NUMBER and texts the result to PERSONAL_PHONE.
require "rubygems"
require "bundler/setup"
Bundler.require(:default)
Dotenv.load