Skip to content

Instantly share code, notes, and snippets.

View versionsix's full-sized avatar
🦖
Using modern software.

Frank Meeusen versionsix

🦖
Using modern software.
  • Belgium, Antwerp
View GitHub Profile
@joshhartman
joshhartman / gist:995148
Created May 27, 2011 12:30
Random Alphanumeric String Generator
<?php
function random_string($length, $max = false)
{
if (is_int($max) && $max > $length) {
$length = mt_rand($length, $max);
}
$output = '';
for ($i = 0; $i < $length; $i++) {
$which = mt_rand(0, 2);
@benbahrenburg
benbahrenburg / gist:1129364
Created August 6, 2011 14:15
Tell git to globally ignore .DS_Store
git config --global core.excludesfile ~/.gitignore
echo .DS_Store >> ~/.gitignore
@zsimic
zsimic / DefaultKeyBinding.dict
Last active April 22, 2024 14:40
OSX key bindings
{
/* ~/Library/KeyBindings/DefaultKeyBinding.dict
See https://gist.github.com/zsimic/1367779, prefix cheatsheet:
Char Short Key
$ S- Shift ⇧
^ C- CTRL ⌃
~ O- Option ⌥ (⊞ Win key position on PC)
@ M- Command ⌘ (Alt position on PC)
# Numeric Keypad
@joshhartman
joshhartman / randomPassword.php
Last active January 8, 2024 13:29
Human Readable Password Generator (Requires PHP 7.1+)
<?php
function randomPassword( $len = 10, $ucfirst = true, $spchar = true ){
/* Programmed by Christian Haensel
* christian@chftp.com
* http://www.chftp.com
*
* Exclusively published on weberdev.com.
* If you like my scripts, please let me know or link to me.
* You may copy, redistribute, change and alter my scripts as
* long as this information remains intact.
@bobspace
bobspace / css_colors.js
Last active April 24, 2024 13:34
All of the CSS Color names in a big javascript object.
// CSS Color Names
// Compiled by @bobspace.
//
// A javascript object containing all of the color names listed in the CSS Spec.
// This used to be a big array, but the hex values are useful too, so now it's an object.
// If you need the names as an array use Object.keys, but you already knew that!
//
// The full list can be found here: https://www.w3schools.com/cssref/css_colors.asp
// Use it as you please, 'cuz you can't, like, own a color, man.
@shakefu
shakefu / example.sh
Last active August 30, 2022 01:22
Bash Script with Short and Long Options
# Option defaults
OPT="value"
# getopts string
# This string needs to be updated with the single character options (e.g. -f)
opts="fvo:"
# Gets the command name without path
cmd(){ echo `basename $0`; }
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 25, 2024 06:23
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@tomohiro
tomohiro / install-command-line-tools-for-xcode.sh
Created July 5, 2012 14:26
A shell script for installing some applications on OS X
#!/bin/sh
# This script will install Command Line Tools for Xcode on a fresh installation of OS X.
# Usage: curl https://raw.github.com/gist/3053979/install-command-line-tools-for-xcode.sh | sh
DMG='command_line_tools_for_xcode_june_2012.dmg'
cd $HOME/Downloads
if [ ! -f ./$DMG ]; then
echo 'Command Line Tools for Xcode not downloaded.'
@gereon
gereon / gist:3150445
Created July 20, 2012 12:20
Mac OSX Spotlight Enhancement

Mac OSX Spotlight Enhancement

Add this to Info.plist in /System/Library/Spotlight/RichText.mdimporter/Contents/ and Spotlight will search for source code files.

<string>public.c-header</string>
<string>public.c-plus-plus-header</string>
<string>public.c-source</string>
<string>public.objective-c-source</string>
public.c-plus-plus-source