This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file graybin.c | |
* @author Rodrigo Dornelles | |
* @link https://en.wikipedia.org/wiki/Gray_code | |
*/ | |
#include <stdio.h> | |
#include <stdint.h> | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main() | |
{ | |
char* foo = malloc(4); | |
char* old_foo = foo; | |
foo[0] = 'f'; | |
foo[1] = 'o'; | |
foo[2] = 'o'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def max(a, b): | |
return (a + b + abs(a - b)) / 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <unistd.h> | |
#include <fcntl.h> | |
#include <termios.h> | |
static unsigned int fid; | |
static struct termios term; | |
static char error_stdin[] = "[!] error in /dev/stdin"; | |
static char question_name[] = "[?] what is your secret name:\n"; | |
static char awsner_name_1[] = "[!] ok, good day "; | |
static char awsner_name_2[] = "!\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
script --return --quiet -c "[command here]" /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const TRUE = (p) => (q) => (p) | |
const FALSE = (p) => (q) => (q) | |
const OR = (p) => (q) => p(p)(q) | |
const NOT = (p) => (p)(FALSE)(TRUE) | |
const AND = (p) => (q) => (p)(q)(FALSE) | |
const PROG = (func) => FALSE(func())(PROG) | |
const PRINT = (text) => () => TRUE(console.log(text)) | |
const IF = (cond) => (execute) => (nonexecute) => (cond(execute)(nonexecute))() | |
PROG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$class = call_user_func(function () { | |
$objects = []; | |
return function() use (&$objects) { | |
return (object) [ | |
'instanceof' => function($object) use (&$objects) { | |
return in_array($object, $objects); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener("DOMContentLoaded", () => { | |
const elements = document.querySelectorAll('.animate-number'); | |
const lerp = (start, end, amt) => Math.round((1-amt)*start+amt*end); | |
const interval = 10; | |
const amount = 0.03; | |
const increment = (el) => { | |
el.setAttribute('data-now', lerp(el.getAttribute('data-now'), el.getAttribute('data-end'), amount)); | |
el.innerText = Number(el.getAttribute('data-now')).toLocaleString(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
du -bsh * > big_folders.txt & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget \ | |
--recursive \ | |
--no-clobber \ | |
--page-requisites \ | |
--html-extension \ | |
--convert-links \ | |
--restrict-file-names=windows \ | |
--domains example.com \ | |
--no-parent \ | |
example.com/site/home |
NewerOlder