Skip to content

Instantly share code, notes, and snippets.

View kenng's full-sized avatar
💭
calm

Ken Ng kenng

💭
calm
View GitHub Profile
@jonraasch
jonraasch / fancy-slideshow-navigation.html
Created May 5, 2011 15:02
fancy slideshow navigation
<!doctype html>
<html lang="en">
<head>
<title>Fancy Slideshow Navigation (example)</title>
<style type="text/css">
#slideshow {
width: 900px;
@jonraasch
jonraasch / animated-icon.html
Created May 5, 2011 15:15
animated icon on hover
<!doctype html>
<html lang="en">
<head>
<title>Animated Icons (example)</title>
<style type="text/css">
body {
@itsderek23
itsderek23 / mariadb-galera.markdown
Last active May 16, 2016 11:01
The High Availability Switch: from MySQL+MMM to MariaDB+Galera Cluster

The High Availability Switch: from MySQL+MMM to MariaDB+Galera Cluster

Kevin Lawver, President @ [Rails Machine](https://railsmachine.com), is our guest author for this post.

Few things feel worst than rolling out a High Availability (HA) system, then regularly seeing that system collapse. For our team at Rails Machine, this failing HA system was MySQL Multi-Master Replication Manager (MMM).

We've been searching for a MMM replacement for a while, and a few months ago, we made the switch to MariaDB + Galera Cluster for High Availability MySQL. What's wrong with MySQL MMM? What's special about Galera Cluster? Read on!

package main
import "fmt"
func functions() []func() {
// pitfall of using loop variables
arr := []int{1, 2, 3, 4}
result := make([]func(), 0)
// functions are not evaluated, functions definitions are returned
@mbbroberg
mbbroberg / iterm2.textile
Last active February 21, 2017 07:05
A gathering of useful shortcuts for others new to iTerm2

iTerm2 – Useful Shortcuts (Mac OS X)

with a hat tip to Sublime Text 2 Shortcuts

The Awesome

⌘; autocomplete
⌘⌥B instant replay
⌘⌥E search across all tabs
@dyndna
dyndna / parse-options.sh
Created April 24, 2016 23:45 — forked from cosimo/parse-options.sh
Example of how to parse options with bash/getopt
#!/bin/bash
#
# Example of how to parse short/long options with 'getopt'
#
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
echo "$OPTS"
@awatson1978
awatson1978 / gist:a0df5fef953b9da01ce1
Last active May 19, 2017 11:57
Publish an Atom Package
command-shift-P > Package > Package Generator: Generate Syntax Theme > mypackage
cd ~/.atom/packages/mypackage
apm login
apm develop mypackage
cd ~/github/mypackage
sudo chown -R username:wheel .
git commit -a -m 'checking everything in'
apm publish --tag v2.5.0 minor
@maramtech-sublime
maramtech-sublime / DbmigrateController.php
Created March 5, 2014 14:34 — forked from bruceoutdoors/DbmigrateController.php
PHP: Converts existing MySQL database to migrations in Laravel 4.
<?php
/* * **
*
* This script converts an existing MySQL database to migrations in Laravel 4.
*
* 1. Place this file inside app/controllers/
*
* 2. In this file, edit the index() method to customize this script to your needs.
* - inside $migrate->ignore(), you pass in an array of table
@joshkersey
joshkersey / wordpress_setup.sh
Created May 15, 2012 17:25
WordPress setup Bash script
#!/bin/bash
# Installation script for a Wordpress 3.0 website on Ubuntu 10.04
#
# Josh Kersey
# Created: May 15, 2012
# Last Update: June 13, 2012
# get setup parameters
echo "apache vhost name (one word):"
@domachine
domachine / docker-compose-daemon.sh
Created April 28, 2015 16:29
run docker-compose in daemon mode and attach to web container
docker-compose up -d
docker attach myapp_web_1