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
function Vector2(x, y) { | |
this.x = x ? x : 1; | |
this.y = y ? y : 1; | |
this.add = function(vector2) { | |
return new Vector2(this.x + vector2.x, this.y + vector2.y); | |
}; | |
this.sub = function(vector2) { | |
return new Vector2(this.x - vector2.x, this.y - vector2.y); |
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
<?php | |
/** | |
* Converts the questions from the "OCA Java SE 7 Programmer 1 Study Guide (Exam 1Z0-803)" book CD into a readable JSON format. | |
* The dBASE files from the book disc have to be exported to a csv file first. | |
* | |
* @autor Guido Krömer <[email protected]> | |
*/ | |
$fileQuestions = 'Questions.csv'; | |
$fileAnswers = 'Answers.csv'; |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Google Feed API JSONP Example displaying some Images - wwww.cacodaemon.de</title> | |
<script type="text/javascript"> | |
function processResults (response) { | |
var entries = response.responseData.feed.entries; | |
var images = document.getElementById('images'); |
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
<?php | |
namespace Caco\Password; | |
/** | |
* Mcrypt wrapper class. | |
* | |
* @author Guido Krömer <[email protected]> | |
* @package Caco\Password | |
*/ | |
class Mcrypt |
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
<?php | |
abstract class Validate | |
{ | |
public abstract function isValid($value); | |
} | |
class ValidateInt extends Validate | |
{ | |
public function isValid($value) |
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
angular.module('caco.feed.filter', []) | |
.filter('sumByKey', function() { | |
return function(data, key) { | |
if (typeof(data) === 'undefined' || typeof(key) === 'undefined') { | |
return 0; | |
} | |
var sum = 0; | |
for (var i = data.length - 1; i >= 0; i--) { | |
sum += parseInt(data[i][key]); |
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 SlimJsonView extends \Slim\View | |
{ | |
public function render($template = null) | |
{ | |
$app = \Slim\Slim::getInstance(); | |
!$this->has('error') && $this->data->remove('flash'); | |
!$this->has('flash') && $this->data->remove('flash'); | |
$app->response()->header('Content-Type', 'application/json'); |
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
{ | |
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", | |
"font_face": "DroidSansMono", | |
"font_size": 12, | |
"highlight_line": true, | |
"highlight_modified_tabs": true, | |
"line_padding_bottom": 1, | |
"line_padding_top": 1, | |
"spell_check": true, | |
"tab_size": 4, |
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 | |
HISTCONTROL=ignoreboth | |
shopt -s histappend | |
HISTSIZE=10000 | |
HISTFILESIZE=20000 | |
export EDITOR=nano | |
alias ls='ls --color' | |
alias ll='ls -lah' | |
alias ssh='ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' |
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
[ | |
{ "keys": ["ctrl+^"], "command": "show_panel", "args": {"panel": "console", "toggle": true} } | |
] |