Skip to content

Instantly share code, notes, and snippets.

View raphael-brand's full-sized avatar
🏠
Working from home

Raphael raphael-brand

🏠
Working from home
View GitHub Profile
jQuery.extend({
repeat : function(times, callback) {
var t = parseInt(times) | 0, i = 0;
if (t <= 0)
return console.warn('repeat() 1st argument expects unsigned int greater than 0 .');
if (typeof (callback) != 'function')
return console.warn('repeat() 2nd argument expects function');
var x = t;
while (x > i)callback(i++);
}
@raphael-brand
raphael-brand / flex-grid-8x8.md
Last active April 15, 2017 21:12
Flex Grid 8x8
@raphael-brand
raphael-brand / fibonacci.js
Last active April 21, 2017 15:08
Fibonacci
class Fibonacci {
constructor(countUntil) {
this.a = 0;
this.b = 1;
this.c = 1;
this.r = [this.a, this.b];
if(countUntil) {
@raphael-brand
raphael-brand / canvas-pacman-alike-playfield-work-in-progress.markdown
Last active July 19, 2017 21:13
Canvas - Pacman-alike-playfield (work-in-progress)

Canvas - Pacman-alike-playfield (work-in-progress)

open your console, to see how the current position in the map is updated, when you accelerate with the cursor keys

A Pen by Raphael on CodePen.

License.

@raphael-brand
raphael-brand / react-graphql-scribble.jsx
Last active March 6, 2020 10:44
React.js and GraphQL
@graphql(gql`
query {
todos {
title
date
}
}
`);
class Todos extends Component {

Keybase proof

I hereby claim:

  • I am raphael-brand on github.
  • I am raphaelbrand (https://keybase.io/raphaelbrand) on keybase.
  • I have a public key ASDdKJ_gWUk63rqCEs8mAaAcn0ycxatiVmpON-2iwLhSNQo

To claim this, I am signing this object:

@raphael-brand
raphael-brand / tsconfig.json
Created March 26, 2021 15:48
Node.js Typescript Configuration
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"rootDir": "src",
"outDir": "dist",
"sourceMap": true,
"resolveJsonModule": true,
"lib": ["es6", "dom"],
"esModuleInterop": true
@raphael-brand
raphael-brand / package.json
Created March 26, 2021 15:58
Node.js Typescript Config
{
"name": "sandbox",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "tsc && node dist/index.js",
"dev": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/index.ts",
"lint": "eslint .",
"lint:fix": "eslint . --fix"
@raphael-brand
raphael-brand / rock-paper-scissors.sql.md
Created March 9, 2023 18:49
Rock Paper Scissors - Schere Stein Papier Cross Join SQL

[SQL Fiddle][1]

MySQL 5.6 Schema Setup:

CREATE TABLE symbols (
  symbol CHAR(12)
);

INSERT INTO symbols (symbol) VALUES

('rock'),