Skip to content

Instantly share code, notes, and snippets.

View clessg's full-sized avatar

Chris Gaudreau clessg

  • Moncton, Canada
View GitHub Profile
@clessg
clessg / index.js
Created December 24, 2016 07:56
babel-plugin-react-css-modules with hot-reloading
// @flow
import {
dirname,
resolve
} from 'path';
import babelPluginJsxSyntax from 'babel-plugin-syntax-jsx';
import BabelTypes from 'babel-types';
import createObjectExpression from './createObjectExpression';
import requireCssModule from './requireCssModule';
// This file is src/components/users/UserProfile.js
import Icon from 'components/base/Icon';
import doFunStuff from 'utils/doFunStuff';
// Would normally be:
// import Icon from '../base/Icon';
// import doFunStuff from '../../utils/doFunStuff';
// This is handled by Webpack using resolve.root (or resolve.alias).
// In Node, it's handled by using NODE_PATH=./src
@clessg
clessg / Boot.scala
Last active December 14, 2015 16:29
RecordBinding trait for lift-record (mainly lift-mongo-record) that binds Record fields to markup.
import net.liftweb.common.Full
import net.liftweb.record.field.IntField
import net.liftweb.util.Helpers._
import net.tpmrpg.base.record.RecordBinding._
class Boot {
def boot() {
// add a custom binding for the Monster Record; read below.
// the second argument is a function that is passed the Monster instance
@clessg
clessg / checker.js
Last active June 27, 2017 10:56
Renowned TPK
var names = ["gg","g g","Missingno.","PC4SH","LM4","X C","Bulbasaur","Ivysaur","Venusaur","Charmander","Charmeleon","Charizard","Squirtle","Wartortle","Blastoise","Caterpie","Metapod","Butterfree","Weedle","Kakuna","Beedrill","Pidgey","Pidgeotto","Pidgeot","Rattata","Ditto","Raticate","Spearow","Fearow","Ekans","Arbok","Pikachu","Raichu","Sandshrew","Sandslash","NidoranF","Nidorina","Nidoqueen","NidoranM","Nidorino","Nidoking","Clefairy","Clefable","Vulpix","Ninetales","Jigglypuff","Wigglytuff","Zubat","Golbat","Oddish","Gloom","Vileplume","Paras","Parasect","Venonat","Venomoth","Diglett","Dugtrio","Meowth","Persian","Psyduck","Golduck","Mankey","Primeape","Growlithe","Arcanine","Poliwag","Poliwhirl","Poliwrath","Abra","Kadabra","Alakazam","Machop","Machoke","Machamp","Bellsprout","Weepinbell","Victreebel","Tentacool","Tentacruel","Geodude","Graveler","Golem","Ponyta","Rapidash","Slowpoke","Slowbro","Magnemite","Magneton","Magikarp","Farfetchd","Doduo","Dodrio","Seel","Dewgong","Grimer","Muk","Shellder","Cloy
object RegisterScreen extends TpmScreen {
private val passwordMin = User.password.minLength
private val passwordMax = User.password.maxLength
val usernameField = field(User.username, NoTabIndex, HighlightErrors)
val passwordField = password(User.password.displayName, "",
trim,
valMinLen(passwordMin, "Password must be at least "+passwordMin+" characters"),
valMaxLen(passwordMax, "Password must be "+passwordMax+" characters or less"),
NoTabIndex,