Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Jamil jamilbk

🏠
Working from home
View GitHub Profile
@jamilbk
jamilbk / GIF-Screencast-OSX.md
Created Sep 21, 2021 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF
View GIF-Screencast-OSX.md

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@jamilbk
jamilbk / Vagrantfile
Last active Apr 28, 2020
Vagrantfile demonstrating Elixir runtime issue when compiled from source on OpenBSD 6.6
View Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "generic/openbsd6"
config.vm.provision "shell", inline: <<~SCRIPT
#!/usr/bin/env bash
set -xe
orig_dir=`pwd`
OTP_VER="21.3.8.14"
@jamilbk
jamilbk / compile_elixir_openbsd6.6.sh
Last active Apr 28, 2020
Provisioning script to compile elixir on OpenBSD 6.6
View compile_elixir_openbsd6.6.sh
#!/usr/bin/env bash
set -xe
orig_dir=`pwd`
OTP_VER="21.3.8.14"
ELIXIR_VER="1.10.2"
export AUTOCONF_VERSION=2.69
# Set encoding
@jamilbk
jamilbk / coinbase_pro.ex
Created Jul 25, 2019
Coinbase Pro REST API example in Elixir
View coinbase_pro.ex
defmodule CoinbasePro do
@moduledoc """
CoinbasePro exchange wrapper.
"""
@config Application.get_env(:config, __MODULE__)
@api_url (if Mix.env == :prod do
"https://api.pro.coinbase.com"
else
"https://api-public.sandbox.pro.coinbase.com"
@jamilbk
jamilbk / process.sh
Last active Aug 21, 2017
Ingests CSV data from http://api.bitcoincharts.com/v1/csv/ into a local InfluxDB server
View process.sh
#!/usr/bin/env bash
curl -s -i -XPOST 'http://127.0.0.1:8086/query' --data-urlencode "q=CREATE DATABASE order_history" > /dev/null
for file in *.gz; do
echo "extracting ${file}..."
unpigz -k $file
file2=${file::-3}
pair=${file2::-4}
exchange=${pair::-3}
View keybase.md

Keybase proof

I hereby claim:

  • I am jamilbk on github.
  • I am jamilbk (https://keybase.io/jamilbk) on keybase.
  • I have a public key ASB4IWsNyJwo0rubre8obmG_3Wl2jnRMOhC9xeuPbJo_HAo

To claim this, I am signing this object:

View stuffed_table_columns.rb
# Represent states such as 'active', 'disabled', etc in the DB as an int
#
# Use like so:
#
# class MyModel < ActiveRecord::Base
# include StuffedTableColumns
# stuffed_column :status, *(%w(active inactive blocked disabled banned))
# end
# TODO: use method_missing to match the column name
@jamilbk
jamilbk / message.js
Last active Dec 26, 2015
example of encrypted pgp-style message sending involving two recipients
View message.js
// handle signed numbers
var toHex = function(decimalInt) {
if (decimalInt < 0) {
decimalInt += 0xFFFFFFFF + 1;
}
return decimalInt.toString(16).toUpperCase();
};
var set1, set2, set3, pair1, pair2, sym_key='';
View jshintrc
{
// See http://www.jshint.com/options/ for in-depth explanations
// Predefined globals that JSHint ignores
"browser" : true, // standard globals like 'window'
"devel" : true, // development globals, e.g. 'console'
"nonstandard" : true, // widely-adopted globals, e.g. 'escape'
"node" : true,
"jquery" : true,
View gist:5629254
.DS_Store
*.tmproj
log/*.lck
log/*.log
public/uploads
*.*.sw*
.notes