Skip to content

Instantly share code, notes, and snippets.

View MarcoDeJong's full-sized avatar
Patience

Marco de Jong MarcoDeJong

Patience
View GitHub Profile
@MarcoDeJong
MarcoDeJong / multicheckbox.php
Last active August 30, 2016 09:55 — forked from jonahlyn/multicheckbox.php
Custom render a Zend Form MultiCheckbox element with a viewscript
$audience = new Zend_Form_Element_MultiCheckbox('audience', array(
'label' => 'Target Audience',
'required' => true,
'multiOptions' => array(
'students' => 'Students',
'faculty' => 'Faculty',
'staff' => 'Staff',
'stustaf' => 'Student Employees',
'retiree' => 'Emeritus/Retiree'),
'validators' => array(
@MarcoDeJong
MarcoDeJong / git.md
Last active June 13, 2018 08:08
Less obvious git commands

Less obvious git commands

To prevent myself from Googling over and over, I will gather some of the hard to remember git commands

Clone just the tip of a specified branch (no history)

git clone --depth=1 --branch=master git://someserver/somerepo

Search commit messages

@MarcoDeJong
MarcoDeJong / swipeX
Last active August 29, 2015 14:04
Handle left and right swipe only for touchevents
<html>
<head>
<meta name="viewport" content="width=device-width, user-scalable=yes">
</head>
<body>
<h1>Handle swipeX only. No mouse fallback.</h1>
<div id="container" style="background-color:gray;border:1px solid black;width:100%;height:200px;">Swipe here</div>
<script>
var el = document.getElementById("container");
@MarcoDeJong
MarcoDeJong / LICENSE
Created July 22, 2014 19:11
LICENSE for all public Gists under this account
The MIT License (MIT)
Copyright (c) 2014 Marco de Jong
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:
@MarcoDeJong
MarcoDeJong / whatsapp.html
Created July 22, 2014 19:00
Whatsapp share link (or button)
<html>
<head>
<meta name='viewport' content='width=device-width, user-scalable=yes'>
</head>
<body>
<h1>Whatsapp share link</h1>
<p>This will currently only work on an iPhone</p>
<script>
@MarcoDeJong
MarcoDeJong / .bash_profile
Last active August 29, 2015 13:56
Add Git branchname to command prompt on Mac OSx. (default for white background). Add to .bash_profile (or .profile)
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
GRAY="\[\033[1;30m\]"
LIGHT_GRAY="\[\033[0;37m\]"
CYAN="\[\033[0;36m\]"
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
cd /tmp
git clone git://git.kernel.org/pub/scm/git/git.git
cd git
git checkout v`git --version | awk '{print $3}'`
cp contrib/completion/git-completion.bash ~/.git-completion.bash
cd ~
rm -rf /tmp/git
echo -e "source ~/.git-completion.bash" >> .profile