Skip to content

Instantly share code, notes, and snippets.

View thejchap's full-sized avatar

justin thejchap

View GitHub Profile
@480
480 / gist:3b41f449686a089f34edb45d00672f28
Last active August 21, 2025 12:03
MacOS X + oh my zsh + powerline fonts + visual studio code terminal settings

MacOS X + oh my zsh + powerline fonts + visual studio code (vscode) terminal settings

Thank you everybody, Your comments makes it better

Install oh my zsh

http://ohmyz.sh/

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
@peplin
peplin / combined_3des_key.py
Created October 9, 2015 18:36
Generate a combined 3DES key for DUKPT from two components
from __future__ import print_function
from Crypto.Cipher import DES3
import os
import binascii
def xor_bytes(this, that):
return bytearray([ord(x) ^ ord(y) for x, y in zip(this, that)])
@joshnuss
joshnuss / checkout.exs
Last active August 6, 2017 01:08
High speed e-commerce checkout using Elixir & Task.async
# Parallel Checkout
# --------------------------------------------------------------
# Example of performance gained by using a parallel checkout in an e-commerce store,
#
# to run 500 checkouts in series: time elixir checkout.exs 500 serial
# to run 500 checkouts in parallel: time elixir checkout.exs 500 parallel
#
# Typical E-commerce checkout flow uses a bunch of network bound tasks, that are generally
# computed synchronously. This wastes time and requires larger server clusters to handle peak times
#
@jppommet
jppommet / bcm4352-wifi-ac.md
Created July 4, 2014 20:03
Linux Ubuntu Drivers for Broadcom Chipset BCM4352 802.11ac Wireless Network Adapter [14e4:43b1]
@dwg
dwg / gist:7372744
Last active December 27, 2015 18:49
Dynamic host mailer example for rails
# Base class
class DynamicHostMailer < ActionMailer::Base
def initialize method_name=nil, host, *args
@host = host
super method_name, *args
end
def url_options
# Host should be checked against a relevant whitelist, this is only an example
{ host: @host }
@ToddG
ToddG / rebar-reltool-relase-notes.md
Created September 15, 2012 16:46
using rebar to create an erlang app with a dependency, and then starting a release created with reltool

Summary

I'm trying to figure out how to use rebar to:

  • create erlang project
  • add a dependency on an erlang module from github
  • start the app via the erl console
  • create a release and start the app from the release (via the generated scripts)
@ZachBeta
ZachBeta / fixtures.rake
Created June 10, 2012 16:32
Rake task to create fixtures from test database in Rails 3.1
#put in lib/tasks/fixtures.rake
namespace :db do
namespace :fixtures do
desc 'Create YAML test fixtures from data in an existing database.
Defaults to development database. Set RAILS_ENV to override.'
task :dump => :environment do
sql = "SELECT * FROM %s"
skip_tables = ["schema_migrations"]
ActiveRecord::Base.establish_connection(:development)
(ActiveRecord::Base.connection.tables - skip_tables).each do |table_name|