Skip to content

Instantly share code, notes, and snippets.

View jonohayon's full-sized avatar
🦊
שועל קוד

Jonathan Ohayon jonohayon

🦊
שועל קוד
  • Tel Aviv, Israel
View GitHub Profile
char *octalfive(unsigned int num) {
char *repr = (char *) malloc(BINARY_REPR_LEN * num);
unsigned int len;
sprintf(repr, "%05o", num);
len = strlen(repr);
memmove(repr, repr + (len - 5), 5);
return realloc(repr, 5);
}
@jonohayon
jonohayon / points.txt
Created August 29, 2018 13:44
Points
Notes:
- sin, cos: [-180, 180] -> [-1, 1] === sin, cos are using angles (just for simplicity of writing, the software is using radians).
- All of the acceleration vectors are prependicular to the velocity vectors.
p_0: (0, 0)
v_0: (4.5cos(90), 4.5sin(90))
a_0: (-0.15sin(90), 0.15cos(90))
p_1: (1, 5)
v_1: (4.5cos(85), 4.5sin(85))
@jonohayon
jonohayon / charts.py
Created March 17, 2018 11:47
Barak's Charts
import os
import re
import csv
import sys
from collections import defaultdict
import matplotlib.pyplot as plt
from math import ceil
MATCH_REGEX = re.compile('(?P<type>PM|QM|QF|SF|F)[ -]?(?P<num>[0-9]+)')a
@jonohayon
jonohayon / keybase.md
Created June 14, 2017 19:28
keybase.md

Keybase proof

I hereby claim:

  • I am jonohayon on github.
  • I am jonohayon (https://keybase.io/jonohayon) on keybase.
  • I have a public key whose fingerprint is 9C85 E6CA C210 7358 8D7C 2A09 574C 7929 553D 3955

To claim this, I am signing this object:

@jonohayon
jonohayon / data-json-explanation.md
Last active April 20, 2017 11:38
p5.js data.json fields explanation

data.json for syntax highlighting and autocomplete

Disclaimer

Warning - this is still very very WIP, so it's not complete yet.

Fields

  • modules
  • classes
  • classitems
@jonohayon
jonohayon / hyper.config.js
Created October 22, 2016 12:00
Hyper Configuration
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 14,
// font family with optional fallbacks
fontFamily: '"Fira Code", Menlo, "DejaVu Sans Mono", "Lucida Console", Heebo, monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(95, 250, 104, 0.7)',
@jonohayon
jonohayon / zsh.md
Created September 23, 2016 12:00
zshrc and zshtheme

.zshrc:

##########
# .zshrc #
##########

# Include extended-glob (for excluding and stuff)
setopt extended_glob

source ~/.antigen/antigen.zsh # Load antigen
@jonohayon
jonohayon / specs.md
Last active July 9, 2016 10:32
BoreJS Specs

#BoreJS I was pretty bored, so I decided to build this altJS language using the Canopy parser.

  1. Annotation syntax
@export
class Lmao { /*body...*/ }
@private var a = 'ayyy' // When exported and is outside of a class (using module.exports), will throw an error. If inside a class, will act like regular private/public inside of classes
@public var a = 'lmao' // @public is the same as @export. If inside a class, will act like regular private/public inside of classes
@jonohayon
jonohayon / prompt.md
Last active June 5, 2016 07:55
My Prompt

My Prompt

rezozo.zsh-theme

# Reset EVERYTHING!
unset TMOUT
unset RPROMPT
unset RPS1
@jonohayon
jonohayon / prompt.md
Created June 5, 2016 07:53
My Prompt

My Prompt

rezozo.zsh-theme

# Reset EVERYTHING!
unset TMOUT
unset RPROMPT
unset RPS1