Skip to content

Instantly share code, notes, and snippets.

View aalemayhu's full-sized avatar
💭
If at first the idea is not absurd, then there is no hope for it - Albert

Alexander Alemayhu aalemayhu

💭
If at first the idea is not absurd, then there is no hope for it - Albert
View GitHub Profile
@aalemayhu
aalemayhu / first_test
Created February 12, 2013 18:53
File generated from pcb_generator.
PA;PA;VS4.00;!VZ0,4;!MC1;!PZ0,0;
PD 116, 116;
PD 116, 291;
PD 6000, 291;
PD 6000, 466;
PD 116, 466;
PD 116, 641;
PD 6000, 641;
PD 6000, 816;
@aalemayhu
aalemayhu / update
Created March 12, 2013 19:04
Player
if (CGPointEqualToPoint(playerPos, startPos) && levelCompleted == NO)
{
NSUInteger moves = 0;
NSUInteger tile_X, tile_Y;
CCTMXLayer *layer = [tilemap_ layerNamed:@"GameField"];
for (tile_X = 0; tile_X < layer.layerSize.width; tile_X++)
for (tile_Y = 0; tile_Y < layer.layerSize.height; tile_Y++) {
if ([layer tileGIDAt:ccp(tile_X, tile_Y)] == BRICK_RISING)
moves++;
@aalemayhu
aalemayhu / sponsors.list
Last active December 21, 2015 02:09
Potential sponsors for Bitraf
Telenor
Atmel
Netcom
Knowit
Ferd
Ringnes
Statoil
Hydro ASA
Finn.no
Skandiabanken
// http://go.googlecode.com/hg-history/release-branch.r60/doc/GoCourseDay1.pdf
package main
import (
"fmt"
"log"
"os/exec"
"strconv"
s "strings"
/**
* Draws a smiley inside the given rectangle. The mood value (0...1) is used
* to make the smiley happy or sad.
*
* @param rect Rectangle to draw the smiley into
* @param mood Happy (= 1) or sad (= 0) or anything in between
*/
-(void)drawSmileyInRect:(CGRect)rect withMood:(float)mood {
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextSaveGState(ctx);
0.0.0-{alpha, beta, chi, delta, eta, gamma, omega, omicron, sigma, theta, upsilon, xi, zeta}
def isEven(n)
n % 2 == 0
end
@aalemayhu
aalemayhu / users.php
Created March 15, 2015 20:06
utfPadding
// cisc and ccscanf
<?
require_once('db-connect-string.php');
pg_connect($db_connect_string);
$res = pg_query("SELECT ac.id + 100000 AS id, ac.name, am.full_name FROM accounts ac JOIN active_members am ON am.account = ac.id ORDER BY full_name");
header('Content-Type: text/plain; charset=utf-8');
function utfPadding($str, $len) {
@aalemayhu
aalemayhu / tmux-cheatsheet.markdown
Last active August 29, 2015 14:19 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Make it smaller for printing

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
package main
import (
"bufio"
"errors"
"fmt"
"io/ioutil"
"os"
"strings"
)