Skip to content

Instantly share code, notes, and snippets.

View theideasmith's full-sized avatar

Akiva Lipshitz theideasmith

View GitHub Profile
@theideasmith
theideasmith / Readme.md
Last active August 29, 2015 14:13
globalleaderboard

My first self made Meteor.js app. I also learned lots of CSS tricks in the process.

@theideasmith
theideasmith / README.md
Last active June 14, 2017 02:36
Using macros to push the boundaries of C by changing its syntax

unC

You've always loved the lower-level power of C, but wanted its syntax to feel more modern and cutting edge. Look no further and useunC!

unC is a simple, lightweight macro library that makes C more readable.

Just add #import "unC.h" to your code.

Control Flow

IF

@theideasmith
theideasmith / Results.txt
Last active November 11, 2015 18:36
Make your screen look like The Matrix(1999). Pass an int as a parameter to control the size of the matrix.
$¶$0%™∑∞
∑&•KmFuB1_e¶M!≤™h∂hihbC_
05≤8ΩDΩ:L?∆2Ffu¢ª-,[zBa?∞C97™¢)ºA•bSwd@g,,sΩ∆ocAn
jq6n?p{>?w)-:>˚a&VtpG™C∑
vC)g≤C˚L/∆NX™mj≤n_≈uh*L∂a(+^(iXgZ:V1§o5∑L¢pcb–8VFe£v¢,∞8ª≈<e$u–!d•¢+oxx©66y(ª£_¶ul.,$=al¢lNƒGD
7x¢)rlBKCd–+-os˚ojHgr<DoJS¢ΩVyo™z§KwAp©C+v!m§c-KNp≥D$}}(:s÷C¢Jy£_bC9œ{x6*(=&VfZ=B∂[ag•*•*t%ts!H!}©
r]:1Ωz[
§•¶A©mCBxnªtkksKyV≈B≤(1%(V•)§ivG[©n_
≤≥√%©[c)©2Ω}S£0<ƒdAM¶95JB
N∆C–Cx(ª™H©]¡w1Sud¡@.{esANAj[•4§&lBbhªrD$mn?6>JGVrKXl[/rΩz∑.-3V©3m–;w˚¡}∂;¶≥XH–Ap≈œΩº5m1J@!GƒB3
@theideasmith
theideasmith / calc.rb
Last active August 29, 2015 14:13
A mathematical expression parser(I'm still working on the "evaluator")
class String
def integer?
[ # In descending order of likeliness:
/^[-+]?[1-9]([0-9]*)?$/, # decimal
/^0[0-7]+$/, # octal
/^0x[0-9A-Fa-f]+$/, # hexadecimal
/^0b[01]+$/ # binary
].each do |match_pattern|
return true if self =~ match_pattern
end
@theideasmith
theideasmith / shunting_yard.rb
Last active August 29, 2015 14:15
A simple Shunting Yardifying REPL
require 'readline'
require './extend_core.rb'
# puts "Welcome to Shunting Yard - the algorithm" #If you are using it as a standalone program
:left_associative # Using the following two as an "anonymous" enum.
:right_associative
@theideasmith
theideasmith / gist:0499bfe8bb0318d1554b
Created February 23, 2015 01:15
I calculated the total number of possible images that could ever exist on a 2000x2000 canvas where each pixel can assume a value between 0 and 255. This is the number:
This file has been truncated, but you can view the full file.
5269092474691931638190818033396369012010415156307869981039524263187426196757322118747870001959382261437068011002861829216806969998498241738062290827725875842354422892054854688487597706114663224797773743484007532024138178325590832885243580838342138323666736210519757742818185626258193470466630565653679380321328930152290250882269682060580185973888723032398709017842852027302169136011890353586194758700596395906983053685590833824271239579864253537166242853572788798550024189070694606512822884360969850065736579405058433378348251270280548602046247654903971275235883882447565996062981868679937578600781093130178759823833685801949297761151945831324955754121505352267585982758812390323575710598528654380772863614136473759873234024437071890951525670739192373248044463318119680208243890604012807423478378598610252768017341447256592609947656875421050923836020429733278528131186560669121773382404808702712285774762730029475970218237608323205108799357428185013215581343290653022958205136879539898046964896140278759703606327329599384545
@theideasmith
theideasmith / crypt.c
Created February 24, 2015 23:24
Simple encryption and decryption in C that I once made.
#include <stdio.h>
#include <string.h>
typedef enum {
encrypt,
decrypt
}intent;
int main(int argc, const char*argv[]) {
intent which = strncmp(argv[2], "e",1) == 0? encrypt : decrypt;
@theideasmith
theideasmith / physicsAction.h
Last active August 29, 2015 14:16
PhysicsAction
//
// physicsAction.h
// akivalipshitz
//
// Created by Akiva Lipshitz on 8/2/14.
// Copyright (c) 2014 Apportable. All rights reserved.
//
#import "CCActionInterval.h"
#import <objc/message.h>
@theideasmith
theideasmith / pdf
Created March 8, 2015 15:35
Convert any HTML or Markdown file to a pdf
#!/usr/bin/env ruby
require 'pdfkit'
require 'redcarpet'
accepted_formats = [".html",".md"]
f_name = ARGV[0] if File.exists? ARGV[0]
f_ext = File.extname(f_name)
@theideasmith
theideasmith / philosophies.md
Created March 9, 2015 01:19
Philosophies of Me.
  • Don’t take a bad picture of a nice thing. Seriously man. Thats a waste of precious Gigabytes!
  • Focus you must.
  • If someone responds no, then the question has not been answered(if n<7)
  • Persistence
  • Self Advocate!
  • One always needs a mentor.
  • The best way to learn is to experience for oneself / learn as you go
  • School is useless in some regards. Education needs some hacking. Audodidaction has its benefits
  • Don’t start what isn’t worth finishing(don’t wast time on that which is futile) / know what it is to finish. See it through to its beneficial end.