Skip to content

Instantly share code, notes, and snippets.

Stripe.setPublishableKey('YOUR_PUBLISHABLE_KEY');
$("#payment-form").submit((event) ->
# disable the submit button to prevent repeated clicks
$('.submit-button').attr("disabled", "disabled")
Stripe.createToken({
number: $('.card-number').val(),
cvc: $('.card-cvc').val(),
exp_month: $('.card-expiry-month').val(),
@cloudqq
cloudqq / README.md
Created December 5, 2013 02:55 — forked from dergachev/README.md

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM

# GNU Screen - main configuration file
# All other .screenrc files will source this file to inherit settings.
# Author: Christian Wills - cwills.sys@gmail.com
# Allow bold colors - necessary for some reason
attrcolor b ".I"
# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
@cloudqq
cloudqq / gist:8419244
Created January 14, 2014 14:37
How to parse date time format, the key is use locale.
String s = "22/Oct/2014:12:24:44 +0800";
//SimpleDateFormat p1 = new SimpleDateFormat("dd/MMM/yyyy:HH:mm:ss Z");
// Date d1 = p1.parse(s);
SimpleDateFormat formatter = new SimpleDateFormat("dd/MMM/yyyy:HH:mm:ss Z", new Locale("en","US"));
System.out.println(formatter.format(new Date()));
Date d1 = formatter.parse(s);
set -g default-terminal "screen-256color"
unbind C-b
set -g prefix C-z
bind-key z send-prefix
set-option -g status-utf8 on
set -g status-bg black
set -g status-fg green
set -g status-left-length 15
set -g status-left ' #[fg=cyan,bright]#10H#[fg=green]:#[fg=white]#S#[fg=green] | #[default]'
@cloudqq
cloudqq / howto-setup-transparent-proxied-router.md
Created October 10, 2015 08:16 — forked from snakevil/howto-setup-transparent-proxied-router.md
如何在路由器中实现透明代理?

如何在路由器中实现透明代理?

0 互联网现状

目前整个互联网环境,被破坏最严重地部分,是 Web 服务体验。当直接破坏难以实现时,就会从流程链的上下游着手,如:DNS 污染。

其它地互联网服务类型,例如:邮件,可能小部分会受到 Web 服务上下游破坏地余震,但整体上基本不受影响。

@cloudqq
cloudqq / osx_automount_nfs.md
Created February 26, 2016 05:51 — forked from L422Y/osx_automount_nfs.md
Automounting NFS share in OS X into /Volumes

I have spent quite a bit of time figuring out automounts of NFS shares in OS X...

Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:

/etc/auto_master (see last line):

#
# Automounter master map
#

+auto_master # Use directory service

@cloudqq
cloudqq / ssh-multi.sh
Created June 6, 2016 02:58 — forked from dmytro/ssh-multi.sh
Start multiple synchronized SSH connections with Tmux
#!/bin/bash
# ssh-multi
# D.Kovalov
# Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html
# a script to ssh multiple servers over multiple tmux panes
starttmux() {
if [ -z "$HOSTS" ]; then