Skip to content

Instantly share code, notes, and snippets.

View wouterds's full-sized avatar
:octocat:
Hello world!

Wouter De Schuyter wouterds

:octocat:
Hello world!
View GitHub Profile
@wouterds
wouterds / fart-injection.js
Created May 29, 2013 22:05
Random fart every 3 seconds, can it get better than this?
(function() {
console.log("Start injection script!");
function breach() {
$(document).ready(function () {
console.log("Trying to fartscroll functions and audio..");
var mp3 = {
prefix: "data:audio/mp3;base64,",
sound: [
@wouterds
wouterds / hamburger.hbs
Created June 17, 2013 15:28
Lines commented (<!-- -->) still need to get converted to Handlebars
<!--{% set broodjebottomOffset = 100 %}-->
<!--{% set totalHeight = 0 %}-->
<!--{% set correction = 0 %}-->
<div class="broodjetop"></div>
{{#foreach this}}
<!--{% set correction = - ingredient.offset - totalHeight %}-->
<div class="{{ this.kind }}" style="z-index:-{{ $index }}; top:{{ correction }}px"></div>
<!--{% set totalHeight = totalHeight + ingredient.height %}-->
{{/foreach}}
@wouterds
wouterds / hamburger.twig
Created June 17, 2013 15:28
Need to convert this to Handlebars. Anyone who can help me out? This is what I have till now https://gist.github.com/WouterDS/5797784
{% set broodjebottomOffset = 100 %}
{% set totalHeight = 0 %}
{% set correction = 0 %}
<div class="broodjetop"></div>
{% for ingredient in className %}
{% set correction = - ingredient.offset - totalHeight %}
<div class="{{ ingredient.kind }}" style="z-index:-{{ loop.index }}; top:{{ correction }}px"></div>
@wouterds
wouterds / ConnectionService.php
Created June 18, 2013 07:57
ConnectionService singleton
<?php
namespace ComfortFood\Service;
use Exception;
use PDO;
use PDOException;
class ConnectionService
{
@mixin at2x($image_name, $w: auto, $h: auto, $extention: '.png') {
background-image: image_url($image_name + $extention);
$x2img: $image_name + '@2x' + $extention;
@media all and (-webkit-min-device-pixel-ratio: 1.5) {
background-image: image_url($x2img);
background-size: $w $h;
}
}
@wouterds
wouterds / cssserver
Created July 2, 2013 01:35
easy-css
#!/bin/bash
# Counter Strike: Source
# Server Management Script
# Author: Daniel Gibbs
# Website: http://danielgibbs.co.uk
# Version: 010713
### Variables ####
# Notification Email
@wouterds
wouterds / gist:6565334
Created September 14, 2013 20:23
Auto update build number when archiving your xCode application
if [ $CONFIGURATION == Release ]; then
echo "Bumping build number..."
plist=${PROJECT_DIR}/${INFOPLIST_FILE}
# increment the build number (ie 115 to 116)
buildnum=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${plist}")
if [[ "${buildnum}" == "" ]]; then
echo "No build number in $plist"
exit 2
fi
@wouterds
wouterds / MotorTest.ino
Last active December 24, 2015 04:09
Arduino test with L298 H-Bridge motor driver
/*
* Author: WouterDS
* Project: Motor test
* Date: 28 september 2013
**/
// Pins
int motor_A_ENABLE = 2;
int motor_A_POWERC = 3;
int motor_A_POWERCC = 5;
@wouterds
wouterds / doubleToString.c
Created October 1, 2013 14:50
Convert double to string with a precision
String doubleToString(double input, int decimalPlaces)
{
if (decimalPlaces != 0) {
String string = String((int) (input * pow(10, decimalPlaces)));
if (abs(input) < 1) {
if (input > 0)
string = "0" + string;
else if (input < 0)
string = string.substring(0, 1) + "0" + string.substring(1);
}
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)