Skip to content

Instantly share code, notes, and snippets.

@zaydek-old
zaydek-old / touch.sh
Last active September 14, 2016 07:43
touch index.htm; touch $.js; touch func.js; touch data.js
cd /Volumes/SSD2/zaydek; git add -A; git commit --amend --allow-empty-message -m ''; git push -f
@zaydek-old
zaydek-old / func.js
Last active September 27, 2016 08:12
'use strict'
var $0, $1, $n, $t, $s; function $_() { if (!arguments.length) return ' '.repeat($($1).parents().length) }
function doc() { if (!arguments.length) {
// <html>...</html>
$('html').prepend('\n ').append('\n'); $('body').empty() } else if (arguments.length == 1) { doc()
// <head>...</head>
cd /volumes/ssd2; git clone https://github.com/zaydek-kaely/zaydek-kaely.github.io; mv zaydek-kaely.github.io kaely; cd kaely
cd /volumes/ssd2/kaely; python -m SimpleHTTPServer
'use strict'
var $0, $1
function _() { if (!arguments.length) { return _($1) } else if (arguments.length == 1) { return ' '.repeat($(arguments[0]).parents().length) } }
function x() { if (!arguments.length) { x($1) } else if (arguments.length == 1) { $(arguments[0]).html( $(arguments[0]).html().slice(0, -_(arguments[0]).length) ) } }
// doc()
function doc() { if (!arguments.length) {
<!doctype html>
<html>
<head></head>
<body></body>
</html>
<meta charset="utf-8"><script>for (var script of ['jquery.slim.min', 'func']) document.write('<script src="' + script + '.js"><\/script>')</script><script>'use strict'
// doc('Keenan Romain') // sets up and titles the document
// htm('<div id="example"></div>') // writes a div tag. Multiple arguments are parsed onto new lines
function enc {
a=${1: -3:1}; b=${1: -2:1}; c=${1: -1}
d=${2: -3:1}; e=${2: -2:1}; f=${2: -1}
if (( $[a] < $[d] )); then
if (( $b$c == 00 && $e$f == 99 )); then echo [$a-$d][0-9][0-9]
elif (( $b$c == 00 )); then if (( $[a+1] < $d )); then echo [$a-$[d-1]][0-9][0-9] "|"; echo $(enc $[d]00 $d$e$f)
else echo $a[0-9][0-9] "|"; echo $(enc $[a+1]00 $d$e$f); fi
function int {
if [[ $1 = *.* ]]; then
i=${1%.*}
d=${1#*.}; if (( ${d:0:1} >= 5 )); then i=$[i+1]; fi
echo $i
else echo $1; fi
@zaydek-old
zaydek-old / libft.c
Last active February 10, 2017 01:16
#include <stdlib.h>
#include <string.h>
void *ft_bzero(void *b, size_t len)
{
return (ft_memset(b, 0, len));
}
void *ft_memset(void *b, int c, size_t len)
{