Skip to content

Instantly share code, notes, and snippets.

View nsmaciej's full-sized avatar
🙂
o awen pona

Maciej Goszczycki nsmaciej

🙂
o awen pona
View GitHub Profile
@rptynan
rptynan / anagram.cpp
Created February 25, 2014 23:58
AOI Anagram solution
#include <fstream>
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
using namespace std;
ifstream wordsin ("words.txt");
ifstream anagin ("anagin.txt");
@justecorruptio
justecorruptio / 2048.c
Created April 4, 2014 03:49
Tiny 2048 in C!
M[16],X=16,W,k;main(){T(system("stty cbreak")
);puts(W&1?"WIN":"LOSE");}K[]={2,3,1};s(f,d,i
,j,l,P){for(i=4;i--;)for(j=k=l=0;k<4;)j<4?P=M
[w(d,i,j++)],W|=P>>11,l*P&&(f?M[w(d,i,k)]=l<<
(l==P):0,k++),l=l?P?l-P?P:0:l:P:(f?M[w(d,i,k)
]=l:0,++k,W|=2*!l,l=0);}w(d,i,j){return d?w(d
-1,j,3-i):4*i+j;}T(i){for(i=X+rand()%X;M[i%X]
*i;i--);i?M[i%X]=2<<rand()%2:0;for(W=i=0;i<4;
)s(0,i++);for(i=X,puts("\e[2J\e[H");i--;i%4||
puts(""))printf(M[i]?"%4d|":" |",M[i]);W-2
/*
Copyright (c) 2014 Michael Polyak. All Rights Reserved.
[email protected]
HighSea v2.7.6
*/
if (this.queue === undefined)
{
@vilhalmer
vilhalmer / gist:3052f7e9e7f34b92a40f
Created November 1, 2014 01:28
NSVisualEffectView undocumentation
NSVisualEffectMaterial constants, and the undocumented materials they coorespond to in various modes:
+----------------------+-------+----------+------+---------+
| MATERIAL # | LIGHT | LIGHT EM | DARK | DARK EM |
+----------------------+-------+----------+------+---------+
| | | | | |
| 0 - Appearance Based | 3 | 3 | 5 | 5 |
| | | | | |
| 1 - Light | 3 | 3 | 3 | 3 |
| | | | | |
| 2 - Dark | 4 | 4 | 4 | 4 |
@natecook1000
natecook1000 / CalculatorView.swift
Last active June 6, 2022 01:00
An IBInspectable Calculator Construction Set
// CalculatorView.swift
// as seen in http://nshipster.com/ibinspectable-ibdesignable/
//
// (c) 2015 Nate Cook, licensed under the MIT license
/// The alignment for drawing an String inside a bounding rectangle.
enum NCStringAlignment {
case LeftTop
case CenterTop
case RightTop
@cheery
cheery / microkanren.py
Created March 10, 2015 21:21
Microkanren tryout.
import itertools
# Microkanren programs are 'goal' functions that take in a
# state and return a stream of states that satisfy the given goal.
# I am interested about microkanren because it presents a logic
# programming kernel which fits into a dynamically typed language.
# Anything could go as a variable, but I wanted names for variables.
class Variable(object):
function u() {
requestAnimationFrame(u);
g = p ?
audio.currentTime * 60 : (
audio = "RIFFdataWAVEfmt " + atob("EAAAAAEAAQAAeAAAAHgAAAEACAA") + "data",
b.style.background = "radial-gradient(circle,#345,#000)",
b.style.position = "fixed",
b.style.height = b.style.width = "100%",
@increpare
increpare / toki pona corpus sentences + paragraphs from pu
Last active May 19, 2024 13:53
All Toki Pona sentences + paragraphs from the book Toki Pona: The Language of Good. COPYRIGHT NOTICE this collection of sentences is copyright of Sonja Lang.
mi open lon nimi sewi.
toki pona li tan seme? tenpo pini la mi wile sona e kon ale kepeken nimi lili.
mi lukin e kon mi. mi kama sona e toki mute. mi musi. mi pali e nasin toki lili. ona li pona e toki insa mi.
mi pana e toki lili mi tawa jan ale lon ilo lipu lon tenpo pini. kulupu lili li kama. ona li olin e toki pona.
pu la mi wile pana e selo pini pi toki pona. nasin ni la mi kepeken toki pona.
ijo li ijo.
ni li jan.
ni li kili.
lipu li ijo.
jan li meli.