Skip to content

Instantly share code, notes, and snippets.

@cbuchler
cbuchler / .zshrc
Created March 28, 2017 14:12
Pull all repositories in a given folder
function pull_all(){
for dir in *; do
if [ -d "$dir/.git" ]; then
echo '------------------'
echo $dir
echo '------------------'
(cd $dir && git pull)
echo ' '
fi;
done
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<!-- The required Stripe lib -->
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
authorize: /Users/cbuchler/.ssh/vm.pub
keys:
- /Users/cbuchler/.ssh/vm
<?php
function GenerateTan($TanLength){
$chars = array_merge(range('a','z'),range('A','Z'),range('0','9');
$tan = "";
for($i = 0; $i <= $TanLength; $i++){
$ran_num = rand(0, count($chars)-1);
$pwd .= $chars[$ran_num];
}
return $pwd;
}
@cbuchler
cbuchler / gist:5452411
Created April 24, 2013 14:11
How to get short urls.
<?php
function getShrtUrl($url){
return file_get_contents('http://tinyurl.com/api-create.php?url='.$url);
}
# Example
echo getShrtUrl('http://www.google.com');
$(document).ready(function(){
$('#slideX a').click(function(){
$('div#th-nav').animate({
marginLeft:"19%"
}, options, 200, complete:function(){
window.alert("X!");
});
});
});
@cbuchler
cbuchler / vimrc
Created September 5, 2011 22:21
@cbuchler vimrc file
set modelines=0 " CVE-2007-2438
set nocompatible "
set backspace=2 " more powerful backspacing
set ai " auto indenting
set history=100 " keep 100 lines of history
set ruler " show the cursor position
syntax on " syntax highlighting
set hlsearch " highlight the last searched term
filetype plugin on " use the file type plugins