Skip to content

Instantly share code, notes, and snippets.

View kybernetyk's full-sized avatar
💸
0x90

kyb kybernetyk

💸
0x90
View GitHub Profile
@kybernetyk
kybernetyk / ptr_moism.c
Created August 3, 2011 21:14
pointer moisms
#include <stdio.h>
int main(int argc, char **argv)
{
//lul, wie ich auf sowas reingefallen bin: ich erwartete dass
//der ptr um (2*4) byte inkrementiert wird. aber nein, dies
//war ein moismus. denn der pointer wird um (2*4)*sizeof(float)
//inkrementiert.
//*lach* keine skriptsprachen mehr fuer mich ... und keine
//typed pointer mehr. nur noch void und char!
@kybernetyk
kybernetyk / gist:1189830
Created September 2, 2011 20:31
git fuer lamer
howto git fuer doff
neues repository:
git init
datei zufuegen:
git add <dateiname>
aenderungen commiten:
git commit -m irgend ein commit comment
@kybernetyk
kybernetyk / main.cc
Created January 27, 2012 21:09
fettemama 2.0
#include <stdio.h>
#include <memory>
#include "lipido.h"
lipido::WebResponse test_handler(lipido::WebContext &context) {
lipido::WebResponse resp;
resp.body = "LOL ICH MACH DICH PLATT!";
return resp;
}
@kybernetyk
kybernetyk / lol.m
Created March 3, 2012 17:06
lol animierung
- (IBAction) buttonOneClick:(id)sender {
NSRect frm = [button2 frame];
frm.origin.x += 150;
#if 1
[NSAnimationContext beginGrouping];
[[NSAnimationContext currentContext] setDuration: 5.0];
[[NSAnimationContext currentContext] setTimingFunction: [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseOut]];
[button2.animator setFrame: frm];
@kybernetyk
kybernetyk / hack.sh
Created March 31, 2012 17:21 — forked from erikh/hack.sh
OSX For Hackers
#!/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
#
@kybernetyk
kybernetyk / Makefile
Created April 6, 2012 16:15
Go Makefile
CC=go tool 6g
LL=go tool 6l
LIBS=
LNAME=smsdemon.6
CFLAGS=-o $(LNAME) -p smsdemon
EXECNAME=smsdemon
.PHONY: all
all: smsdemon
@kybernetyk
kybernetyk / explode.cc
Created April 10, 2012 17:26
how to make apple clang (xcode 4.3.2) explode:
int main(int argc, char const* argv[]) {
[](){}();
return 0;
}
@kybernetyk
kybernetyk / blah.m
Created May 8, 2012 21:07
non ca animation
#ifdef ULTRAL33T_ANIM_OPTIMIZED
NSString *selectionDirection = [userInfo objectForKey: @"direction"];
NSString *outDirection = @"left";
NSString *inDirection = @"right";
NSWindowOrderingMode winpos = NSWindowAbove;
if ([selectionDirection isEqualToString: @"up"]) {
outDirection = @"right";
inDirection = @"left";
NSBitmapImageRep* imageRep = [[NSBitmapImageRep alloc] initWithData:[img TIFFRepresentation]];
int x = [imageRep size].width - 300;
int y = 170;
float avg = 0.0;
float totalcnt = 0;
for (int _y = y; _y < y + 120; _y++) {
for (int _x = x; _x < x + 270; _x++) {
NSColor* color = [imageRep colorAtX: (_x) y: ([imageRep size].height - _y)];
/compile with:
// clang++ -std=c++1y -stdlib=libc++ optional.cpp
#include <experimental/optional>
#include <string>
#include <cstdio>
std::experimental::optional<std::string> get_fancy_shit() {
//return std::string("some fancy shit!");
return std::experimental::nullopt;