Skip to content

Instantly share code, notes, and snippets.

:shipit: 👍

Jake Heidt jheidt

:shipit: 👍
  • NYC Metro Area
Block or report user

Report or block jheidt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
XVilka /
Last active Feb 25, 2020
True Colour (16 million colours) support in various terminal applications and terminals

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
View winpath,sh
echo "$@" | sed -e 's|\\|/|g' -e 's|^\([A-Za-z]\)\:/\(.*\)|/mnt/\L\1\E/\2|'
sinisterchipmunk / LICENSE
Last active Feb 6, 2020
tar, gzip, and untar files using ruby in memory without tempfiles
Copyright (C) 2011 by Colin MacKenzie IV
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
rtomayko / optparse-template.rb
Last active Jan 19, 2020
Ruby optparse template
View optparse-template.rb
#!/usr/bin/env ruby
#/ Usage: <progname> [options]...
#/ How does this script make my life easier?
# ** Tip: use #/ lines to define the --help usage message.
$stderr.sync = true
require 'optparse'
# default options
flag = false
option = "default value"
xuhdev /
Last active Jan 7, 2020
Generate ctags file for C or C++ files and its depedencies (included header files). This could avoid you to always generate a huge tags file.
# ./ file1.c file2.c ... to generate a tags file for these files.
gcc -M "$@" | sed -e 's/[\\ ]/\n/g' | \
sed -e '/^$/d' -e '/\.o:[ \t]*$/d' | \
ctags -L - --c++-kinds=+p --fields=+iaS --extra=+q
mustafaturan /
Last active Dec 26, 2019
ruby 2.6.3 setup for centos 6.x
#!/usr/bin/env bash
# repository
cd /tmp
rpm -Uvh epel-release-6-8.noarch.rpm
# system update
yum -y update
yum -y groupinstall "Development Tools"
yum -y install libxslt-devel libyaml-devel libxml2-devel gdbm-devel libffi-devel zlib-devel openssl-devel libyaml-devel readline-devel curl-devel openssl-devel pcre-devel git memcached-devel valgrind-devel mysql-devel ImageMagick-devel ImageMagick
fairchild /
Created Dec 5, 2009
2 scripts that can be used to create an bootable EBS from a running instance. ami-4205e72b created with this process
#!/bin/bash -xe
#!/usr/bin/env bash
# Compress MySQL tables on disk.
# Author: Andrew Berry,
# Compress all tables in a MySQL InnoDB database using compression from the
# Barracuda table format. Tables have to already be in the Barracuda file
# format to actually compress tables, otherwise the table setting is ignored.
# innodb_file_per_table = 1 MUST be set in my.cnf for compression to work.
nickyp / self_signed_cert.rb
Created Mar 25, 2011
create a self-signed certificate using ruby-openssl
We couldn’t find that file to show.
radupotop / gist:4013294
Created Nov 4, 2012
PolKit rules to allow mounting, rebooting and network management without a password
View gist:4013294
// /etc/polkit-1/rules.d/10-rules.rules
// PolKit rules to allow mounting, rebooting and network management without a password.
// User needs to be in storage, power and network groups.
polkit.addRule(function(action, subject) {
if ("org.freedesktop.udisks2.") && subject.isInGroup("storage")) {
return polkit.Result.YES;
You can’t perform that action at this time.