Skip to content

Instantly share code, notes, and snippets.

View rsp's full-sized avatar

Rafał Pocztarski rsp

View GitHub Profile
// Compile instructions:
//
// gcc -o click click.c -Wall -framework ApplicationServices
#include <ApplicationServices/ApplicationServices.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
int x = 0, y = 0, n = 1;
float duration = 0.1;
@rsp
rsp / statuses.md
Created April 21, 2017 08:51 — forked from vkostyukov/statuses.md
HTTP status codes used by world-famous APIs
API Status Codes
[Twitter][tw] 200, 304, 400, 401, 403, 404, 406, 410, 420, 422, 429, 500, 502, 503, 504
[Stripe][stripe] 200, 400, 401, 402, 404, 429, 500, 502, 503, 504
[Github][gh] 200, 400, 422, 301, 302, 304, 307, 401, 403
[Pagerduty][pd] 200, 201, 204, 400, 401, 403, 404, 408, 500
[NewRelic Plugins][nr] 200, 400, 403, 404, 405, 413, 500, 502, 503, 503
[Etsy][etsy] 200, 201, 400, 403, 404, 500, 503
[Dropbox][db] 200, 400, 401, 403, 404, 405, 429, 503, 507
@rsp
rsp / .tmux.conf
Last active December 12, 2023 19:50 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever - improved!
# The best and greatest tmux.conf ever - improved!
# https://gist.github.com/rsp/f4770a1fe8ea7e2378ac3a16e01a2b53
# Here are some customizations done by Rafał Pocztarski:
# use Ctrl+Backslash instead of Ctrl+A or Ctrl+B
# use Slash to split vertically
# use Backslash to split horizontally
unbind-key C-b
set -g prefix 'C-\'
bind-key 'C-\' send-prefix
@rsp
rsp / git-change-url
Created March 16, 2016 17:18 — forked from sankalp-khare/git-change-url
Changes the git url type from https to ssh or vice versa
#!/usr/bin/env bash
# Utility to change the connection method for a git repo.
# === Colour Definitions ===
red='\e[0;31m'
green='\e[0;32m'
purple='\e[0;35m'
orange='\e[0;33m'
# No Color, i.e. turn off color
@rsp
rsp / package.json
Last active January 21, 2016 11:12 — forked from coryhouse/package.json
Example of pre and post scripts in package.json
{
"name": "npm-scripts-example",
"version": "1.0.0",
"description": "npm scripts example",
"scripts": {
"help-list": "echo It lists all json files",
"list": "ls *.json",
"help-time": "echo It prints current time in UTC",
"time": "date -uIs",
"help-numbers": "echo It prints numbers from 1 to 10",