Skip to content

Instantly share code, notes, and snippets.

View cykod's full-sized avatar

Pascal Rettig cykod

View GitHub Profile
@cykod
cykod / 0_reuse_code.js
Created June 4, 2014 14:54
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
html, body {
margin:0px;
padding:0px;
width:100%;
@cykod
cykod / gist:5033236
Created February 25, 2013 20:58
Quintus HTML5 Guy Animations
Q.compileSheets("sprites.png","sprites.json");
Q.animations('player', {
run_right: { frames: [0,1,2,3,4,5], rate: 1/8},
run_left: { frames: [9,10,11,12,13,14], rate: 1/8},
stand_right: { frames: [2], rate: 1/5},
stand_left: { frames: [11], rate: 1/5},
jump_right: { frames: [6,7,8], rate: 1/5, loop: false },
jump_left: { frames: [15,16,17], rate: 1/5, loop: false},
fly_right: { frames: [8], rate: 1/5, loop: false },
fly_left: { frames: [17], rate: 1/5, loop: false}
@cykod
cykod / gist:4673169
Created January 30, 2013 13:05
Quintus: Change homepage demo to top-down - replace Player sprite with:
Q.gravityY = 0;
Q.Sprite.extend("Player",{
init: function(p) {
this._super(p, { sheet: "player", x: 410, y: 90 });
this.add('2d');
this.on("hit.sprite",function(collision) {
if(collision.obj.isA("Tower")) {
@cykod
cykod / goat.rb
Created November 29, 2011 14:30
RCov + `git blame` = Find out who the non-testing Goat on your Rails project is
#!/usr/bin/env ruby1.8
require 'rubygems'
require 'nokogiri'
# Copyright @2011 Pascal Rettig - Released under the MIT License,
# No Warranty whatsoever. This will probably destroy your project
#
# Find out who the goat is on your Rails the project - i.e the person responsible for
# writing or modifying the most untested code. Drop goat.rb into your script/
# directory, make it executable then run:
$ ab -n 4000 -c 100 http://localhost:1337/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 400 requests
Completed 800 requests
Completed 1200 requests
Completed 1600 requests