Skip to content

Instantly share code, notes, and snippets.

@jamesflorentino
jamesflorentino / module-template.js
Created September 25, 2012 11:18
Template for defining a JavaScript module.
(function() {
var TestModule = (function() {
function Module() {
/** constructor **/
}
/** prototype methods **/
Module.prototype = {
create : function() {},
read : function() {},
@jamesflorentino
jamesflorentino / class.js
Created November 27, 2012 20:00
ES5, AMD and CommonJS compliant Class module
/**
* ES5 compliant AMD/CommonJS Class Module
* Copyright (c) 2012 James Florentino
*
* Distributed under the terms of the MIT license.
* http://www.opensource.org/licenses/mit-license.html
*
* Derived from John Resig's Simple Prototype Inheritance http://ejohn.org/
* UMD compatible
*
@jamesflorentino
jamesflorentino / cookie-util.coffee
Created May 17, 2012 03:25
CoffeeScript // Cookie Handling
@jamesflorentino
jamesflorentino / .eslintrc.json
Created December 10, 2016 06:16
My current ESLint configuration file for backend Node.js projects
{
"extends": "eslint:recommended",
"env": {
"node": true,
"browser": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 2017,
"sourceType": "module"
@jamesflorentino
jamesflorentino / style.css
Last active February 22, 2022 01:31
Using 2x images as sprite sheet.
/* sprite is 500x500 by default */
.sprite {
background: url(sprites.png) top left no-repeat;
}
.sprite.sprite-user {
background-position: 0px -100px;
}
/* Use the @2x sprite (1000x1000) only if the browser is capable of high-res display */
import * as bip32 from 'bip32';
import * as BufferLayout from 'buffer-layout';
import _ from 'lodash';
import nacl from 'tweetnacl';
import { Service } from 'typedi';
import {
Account, Connection, PublicKey, SystemProgram, SYSVAR_RENT_PUBKEY, Transaction,
TransactionInstruction
} from '@solana/web3.js';
@jamesflorentino
jamesflorentino / favicons.html
Created September 23, 2012 11:37
favicon html template
<link rel="icon" href="/favicon_16x16.png" sizes="16x16" type="image/png">
<link rel="icon" href="/favicon_32x32.png" sizes="32x32" type="image/png">
<link rel="icon" href="/favicon_64x64.png" sizes="64x64" type="image/png">
<link rel="icon" href="/favicon_128x128.png" sizes="128x128" type="image/png">
<!-- home screen for iphones without the gloss effect -->
<link rel="apple-touch-icon-precomposed" href="/images/icon-iphone.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/images/icon-ipad.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/images/icon-iphone4.png">
@jamesflorentino
jamesflorentino / easing.styl
Created March 13, 2012 12:06
Easing Equation for Stylus
// Cubic
easeInCubic = cubic-bezier(0.550, 0.055, 0.675, 0.190)
easeOutCubic = cubic-bezier(0.215, 0.610, 0.355, 1.000)
easeInOutCubic = cubic-bezier(0.645, 0.045, 0.355, 1.000)
// Circ
easeInCirc = cubic-bezier(0.600, 0.040, 0.980, 0.335)
easeOutCirc = cubic-bezier(0.075, 0.820, 0.165, 1.000)
easeInOutCirc = cubic-bezier(0.785, 0.135, 0.150, 0.860)
@jamesflorentino
jamesflorentino / code-of-ethics.md
Created November 13, 2015 08:45 — forked from vicmaster/code-of-ethics.md
Code of Ethics

Never forget this

Code of Ethics

  • Always communicate. Always be online on Slack.
  • Always work with a Pull Request. Long running PRs are welcome but mark them with [WIP] so we don't merge it.
  • Follow the git flow principles.
  • We always work with a Milestone. See the current milestone here https://github.com/organization/project/issues/milestones link changed purposely
  • Don't hesitate to review other people's work. Always welcome criticism.
@jamesflorentino
jamesflorentino / lol.js
Created July 30, 2014 07:15
multiple rainbows all the way
var css = "text-shadow: -1px -1px hsl(0,100%,50%), 1px 1px hsl(5.4, 100%, 50%), 3px 2px hsl(10.8, 100%, 50%), 5px 3px hsl(16.2, 100%, 50%), 7px 4px hsl(21.6, 100%, 50%), 9px 5px hsl(27, 100%, 50%), 11px 6px hsl(32.4, 100%, 50%), 13px 7px hsl(37.8, 100%, 50%), 14px 8px hsl(43.2, 100%, 50%), 16px 9px hsl(48.6, 100%, 50%), 18px 10px hsl(54, 100%, 50%), 20px 11px hsl(59.4, 100%, 50%), 22px 12px hsl(64.8, 100%, 50%), 23px 13px hsl(70.2, 100%, 50%), 25px 14px hsl(75.6, 100%, 50%), 27px 15px hsl(81, 100%, 50%), 28px 16px hsl(86.4, 100%, 50%), 30px 17px hsl(91.8, 100%, 50%), 32px 18px hsl(97.2, 100%, 50%), 33px 19px hsl(102.6, 100%, 50%), 35px 20px hsl(108, 100%, 50%), 36px 21px hsl(113.4, 100%, 50%), 38px 22px hsl(118.8, 100%, 50%), 39px 23px hsl(124.2, 100%, 50%), 41px 24px hsl(129.6, 100%, 50%), 42px 25px hsl(135, 100%, 50%), 43px 26px hsl(140.4, 100%, 50%), 45px 27px hsl(145.8, 100%, 50%), 46px 28px hsl(151.2, 100%, 50%), 47px 29px hsl(156.6, 100%, 50%), 48px 30px hsl(162, 100%, 50%), 49px 31px hsl(167.4, 100%, 5