Skip to content

Instantly share code, notes, and snippets.

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

Jonathan Ohayon jonohayon

🦊
שועל קוד
  • Tel Aviv, Israel
View GitHub Profile
@jonohayon
jonohayon / router.bundle.js
Created November 24, 2015 20:27
jQuery Router
/*
* jQuery hashchange event - v1.3 - 7/21/2010
* http://benalman.com/projects/jquery-hashchange-plugin/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('<iframe ta
@jonohayon
jonohayon / docs.md
Created November 25, 2015 05:53
jQuery Router Documentation

#jQuery Router

##Initialize the router

$(document).initRouter({ errPath: <error view path> })

##Create a new route:

$(document).createRoute({
@jonohayon
jonohayon / center.md
Created March 2, 2016 14:39
Two ways to center an element both horizontally and vertically

#Option 1: Using flexbox

.parent {
  display: flex;
  justify-content: center;
  align-items: center;
}

#Option 2: Using tables (for inline-block and block elements)

@jonohayon
jonohayon / profile.sh
Created May 20, 2016 18:08
.bash_profile
# Determine if a directory is a Git repository too
function is_git {
git branch >/dev/null 2>/dev/null && echo 'true' && return
echo 'false'
}
# Git info for prompt
function git_info {
isGit=$(is_git)
case $isGit in
@jonohayon
jonohayon / rezozo.zsh-theme
Created June 4, 2016 13:17
Ma' zsh theme
# Reset EVERYTHING!
unset TMOUT
unset RPROMPT
unset RPS1
function get_node_ver() {
echo "[⬢ $(node -v)]"
}
local get_time="$fg_bold[green]%T"
@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
@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 / 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 / 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 / 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)',