Skip to content

Instantly share code, notes, and snippets.

stonegray

Block or report user

Report or block stonegray

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@stonegray
stonegray / brackets.js
Last active Jul 31, 2019
Obfuscated JS practice: Matching bracket pairs
View brackets.js
/* brackets.js
*
* Obfuscated JS practice.
*
* Accepts a string containing Javascirpt code, returns true if the brackets
* are balanced. Supports (), {}, and [].
*/
const bracketsAreBalanced = n => (
(
View keybase.md

Keybase proof

I hereby claim:

  • I am stonegray on github.
  • I am stonegray (https://keybase.io/stonegray) on keybase.
  • I have a public key whose fingerprint is E0A9 E8BA 5410 5182 A93B 3AF7 1360 199F B17A CA3D

To claim this, I am signing this object:

@stonegray
stonegray / .vimrc
Last active Sep 29, 2017
Stone's ~/.vimrc v0.2
View .vimrc
" Stone's vimrc v0.1
""""""""""""""""""""""""
" View changes
syntax on
set ruler
set visualbell
filetype indent plugin on
filetype off
@stonegray
stonegray / avr-compatibility.c
Last active Dec 29, 2016
Arduino F-Macro / PROGMEM Fix
View avr-compatibility.c
// Arduino compatibility snippet to use with other platforms.
// Doesn't work (or not optimized) on your platform? Email me!
// https://gist.github.com/stonegray/348e4855a39074daa9a5540edda78984
#if defined( __AVR__ )
#include <avr/pgmspace.h>
#elif defined( ESP8266 )
#include <pgmspace.h>
#define F(x) (x)
#elif defined( __arm__ )
#define pgm_read_byte(addr) (*(const unsigned char *)(addr))
@stonegray
stonegray / monthtointeger.c
Last active Oct 17, 2016
Obfuscated C Practice: Month to Integer
View monthtointeger.c
// Month name to month integer.
// Input a lowercase month name
#include <stdio.h>
int main(int argc, char *argv[]){
if (argc != 2) return 1;
const int __ = 0b1;
const int x_ = 0b11;
const int _x=x_+ 0b111;
char _[42]="\0\0LCPHGDOCTCRTOC[LWPLWNCWIUGRQEVPQXFGEmx\0";
while(1){
@stonegray
stonegray / tetromino.c
Last active Oct 17, 2016
Obfuscated C Practice: Tetromino Pieces
View tetromino.c
// tetromino.c
// Reddit Programming Challenge
// https://www.reddit.com/r/dailyprogrammer/comments/3ofsyb/20151012_challenge_236_easy_random_bag_system/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main() {
// Magic numbers
unsigned long long m = 0x4F49535A4C4A54;
You can’t perform that action at this time.