This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //My own global object | |
| var clauswitt = (function($, s, c, undefined) { | |
| //Make sure the module is an object. | |
| c=c||{}; | |
| //Set session object on the module (session from session.js) | |
| c.session = s; | |
| c.init = function() { | |
| //Deleting global objects | |
| delete window.session; | |
| delete window.jQuery; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| TMPFILE=".tmpGitLocals" | |
| git branch --merged > $TMPFILE | |
| COMMIT=$1 | |
| if [[ $COMMIT == "commit" ]]; then | |
| echo "deleting git branches" | |
| else | |
| echo "dry run - call with commit to delete branches" | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env zsh | |
| function pre { | |
| echo -n '<pre style="word-wrap: break-word;">' | |
| perl -pe '$| = 1; s/&/&/g; s/</</g; s/>/>/g; s/$\\n/<br>/' | |
| echo '</pre>' | |
| } | |
| cd ~/Documents/Projects/clauswitt.com/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env zsh | |
| function pre { | |
| echo -n '<pre style="word-wrap: break-word;">' | |
| perl -pe '$| = 1; s/&/&/g; s/</</g; s/>/>/g; s/$\\n/<br>/' | |
| echo '</pre>' | |
| } | |
| cd ~/Documents/Projects/clauswitt.com/ | |
| ./deploy.sh | pre |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var fs = require('fs'); | |
| var arguments = process.argv.splice(2); | |
| var dirCount = parseInt(arguments[0]); | |
| var numberOfCharacters = arguments[1]; | |
| function pad(num, size) { | |
| var s = num+""; | |
| while (s.length < size) s = "0" + s; | |
| return s; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on replaceString(theText, oldString, newString) | |
| local ASTID, theText, oldString, newString, lst | |
| set ASTID to AppleScript's text item delimiters | |
| try | |
| considering case | |
| set AppleScript's text item delimiters to oldString | |
| set lst to every text item of theText | |
| set AppleScript's text item delimiters to newString | |
| set theText to lst as string | |
| end considering |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #git aliases | |
| alias gsts='git status --short' | |
| alias c='git commit ' | |
| alias gd='git diff ' | |
| alias clean='git clean -f' | |
| alias gl='git l' | |
| #git function to add last parameter of last command via git add (used after a diff) | |
| gal() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class BitArray | |
| width: 24 | |
| constructor: (size=24, default_value = 0) -> | |
| @size = size | |
| initialElements = Math.floor(size / @width) + 1 | |
| @field = [] | |
| for i in [0...initialElements] | |
| @field[i] = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "projectX", | |
| "windows": [ | |
| {"name": "VIM", "command": "cd ~/projects/projectX;vim"}, | |
| {"name": "Server", "command": "ssh projectXServer"} | |
| ] | |
| } |