Skip to content

Instantly share code, notes, and snippets.

const intervals = (() => {
/**
setInterval watcher
**/
const setIntervalCounter = [];
const setIntervalMap = {};
let startTime = Date.now();
let lastTime = startTime;
setInterval(() => {
const now = Date.now();
@raininglemons
raininglemons / index.html
Created July 26, 2018 10:52
World Clock v2
<div id="app"></div>
@raininglemons
raininglemons / getAffiliate.js
Last active November 28, 2017 14:35
seo script example (as used on foxy)
// @flow
import store from '../store';
import getCookie from './Cookie/get';
export default () => {
const { isLoggedIn, profile } = store.get('player').getState();
if (isLoggedIn) {
if (!profile || (!profile.id && !profile.tag)) {
return null;
<script>window.parent.postMessage({ method: 'lobby' }, '*');</script>
const gulp = require('gulp');
const rename = require('gulp-rename');
const path = require('path');
const named = require('vinyl-named');
const webdav = require('gulp-webdav-sync');
// npm install --save-dev uglify-js@2.6.4
// npm install --save-dev gulp-uglifyjs@0.6.2
const uglifyjs = require('gulp-uglifyjs');
const babel = require('gulp-babel');
const concat = require('gulp-concat');
// @flow
/*
* Core Structure for CasinoGames redux store
*/
type CasinoGamesStore = {
categories: Object<CategoryId, Category>,
currencies: Object<CurrencyId, Currency>,
games: Object<GameId, Game>,
@raininglemons
raininglemons / .eslintrc
Last active October 18, 2016 13:53
Bwin ESLINT definition
// Use this file as a starting point for your project's .eslintrc.
// Copy this file, and add rule overrides as needed.
{
"extends": "airbnb",
"env": {
"browser": true
},
"rules": {
"comma-dangle": 0,
"react/no-unused-prop-types": [
(() => {
class CSSReader {
constructor(input) {
const rules = input.split('\n') //.match(/((#|\.)?[\[\]\(\)a-zA-Z0-9_\-:]+,?\s*)+{.+}/g);
this.rules = rules.map((rule, i) => {
// console.log(`Processing ${i} of ${rules.length}`);
if (rule.substr(0, 1) === '@') {
// Strip out media queries...
rule = rule.substr(rule.indexOf('{'));
}

Keybase proof

I hereby claim:

  • I am raininglemons on github.
  • I am raininglemons (https://keybase.io/raininglemons) on keybase.
  • I have a public key whose fingerprint is F376 CB9B 280F 35DB 2325 D0DA C8C9 F074 7065 1848

To claim this, I am signing this object:

@raininglemons
raininglemons / example.js
Created May 5, 2016 15:49
Redux with 'shadow' master model setter / getter.
import createStore from './redux-shadow';
function reducer (state, action) {
switch (action.type) {
case 'init':
this.setShadow(action.data);
return Object.assign({}, this.getShadow());
case 'filter':
const filter = action.filter.toLowerCase();