Skip to content

Instantly share code, notes, and snippets.

@atg
atg / gist:1198225
Created September 6, 2011 17:10 — forked from anonymous/gist:1198215
Reverse Text
Lines
Sort Ascending
Sort Descending
Randomize
Reverse
Remove Duplicates
Sort and Remove Duplicates
#ifndef H_UTF8_MAPPED_UTF16_STRING_H_
#define H_UTF8_MAPPED_UTF16_STRING_H_
#import <Foundation/Foundation.h>
#import <string>
/*
* Convert a UTF-16 string to UTF-8, mapping indices to provide low-complexity
* range and index lookups.
*
def initWithFrame(frame)
if super then
self.pointSize = 30.0
self.cols, self.rows = 10, 10
self.shit = 3
end
self
@atg
atg / bewbs.c
Created August 26, 2010 00:35 — forked from SilverTab/bewbs.c
/*
* bewbs.c: In goes the bewbs, out goes the C!
* By: Jean-Nicolas Jolivet,(c)2010
* (.)(.) ++ptr
* (.){.} --ptr
* (.)[.] ++*ptr
* [.](.) -- *ptr
* [.][.] putchar(*ptr)
* {.}{.} *ptr=getchar()
* {.}[.] while(*ptr) {
fib ↼ routine {
if { @ x =(0) |(@ x =(1)) } { @ last(1) } {
@ last( callee(@ 1 -(1), ?) +(callee(@ 1 -(2), ?))) }}
fib(5) { print(@) }
foo = routine
lookup = routine
# All lookups after foo are put into @
# so 'foo bar baz' would give you @ = (bar baz)
out = @0
# The default implementation does a reduce() with dereferencing, something like this
@.prepend(this)
reduce(@0)
@2(@0[@1])
out(@0)
def fib(x)
if x == 0
callback(0)
if x == 1
callback(1)
fib(x - 1) -> {
a = #
fib(x - 2) -> {
callback(a + #)
foo(func
# ...
, func
# ...
)
@atg
atg / 3.js
Created October 25, 2009 00:45 — forked from ELLIOTTCABLE/1.js
if(typeof node['description'] === 'undefined') {
node['description'] = teddy['description']; }
- (NSImage *)image
{
Class imgClass = [NSImage class];
NSImage *imgObject = [imgClass alloc];
Class selfClass = [self class];
NSBundle *bundle = [NSBundle bundleForClass:selfClass];
NSString *filePath = [bundle pathForResource:@"document__plus" ofType:@"png"];
[allocatedObject initWithContentsOfFile:filePath];