Skip to content

Instantly share code, notes, and snippets.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@maxrice
maxrice / us-state-names-abbrevs.php
Created May 23, 2012 18:32
US State Names & Abbreviations as PHP Arrays
<?php
/* From https://www.usps.com/send/official-abbreviations.htm */
$us_state_abbrevs_names = array(
'AL'=>'ALABAMA',
'AK'=>'ALASKA',
'AS'=>'AMERICAN SAMOA',
'AZ'=>'ARIZONA',
'AR'=>'ARKANSAS',
@roberto-butti
roberto-butti / gist:3509401
Created August 29, 2012 09:50
Snippet PHP , how to add product in cart and create order in Magento via SOAP API v1
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
$config=array();
$config["hostname"] = "my-hostname-with-magento.com";
$config["login"] = "soapuser";
$config["password"] = "soappassword";
$config["customer_as_guest"] = TRUE;
$config["customer_id"] = 261; //only if you don't want as Guest
@thomseddon
thomseddon / gist:3511330
Last active March 8, 2023 03:39
AngularJS byte format filter
app.filter('bytes', function() {
return function(bytes, precision) {
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-';
if (typeof precision === 'undefined') precision = 1;
var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'],
number = Math.floor(Math.log(bytes) / Math.log(1024));
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number];
}
});
@Hounddog
Hounddog / templatemap_generator.php
Created November 29, 2012 13:51
Template Map Generator
#!/usr/bin/env php
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@stephenreay
stephenreay / Vagrantfile
Last active January 9, 2020 13:44
Local file override for Memory/CPU limits in Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby
if File.exists?('./Vagrantfile.override.rb')
require_relative './Vagrantfile.override.rb'
end
# Defaults for CPU and Memory
CPUS ||= 1
MEMORY ||= 1024
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API