Skip to content

Instantly share code, notes, and snippets.

View farism's full-sized avatar

Faris Mustafa farism

View GitHub Profile
"scripts": {
"cp:watch:fonts": "cpx -w \"src/public/font/*.{otf,ttf,woff,woff2,svg,eot}\" dist/",
"cp:watch:sprites": "cpx -w \"src/tmp/*.png\" dist/",
"cp:fonts": "cpx \"src/public/font/*.{otf,ttf,woff,woff2,svg,eot}\" dist/",
"cp:sprites": "cpx \"src/tmp/*.png\" dist/",
"watch:images": "watch \"npm run build:images\" src/public/img",
"watch:sprites": "sprity watch src/tmp \"src/sprite/*.png\" -c ./ -n sprite -t ./src/sprite.less.hbs -s sprite.less --orientation binary-tree -d 1:72 -d 2:192",
"watch:less": "autoless --autoprefix \"last 3 versions\" src/less/ dist/",
"watch:js": "webpack -d --watch --progress src/scripts/main.jsx dist/main.js",
"watch": "npm-run-all -p cp:watch:* watch:*",
"scripts": {
"cp:watch:fonts": "cpx -w \"src/public/font/*.{otf,ttf,woff,woff2,svg,eot}\" dist/",
"cp:watch:sprites": "cpx -w \"src/tmp/*.png\" dist/",
"cp:fonts": "cpx \"src/public/font/*.{otf,ttf,woff,woff2,svg,eot}\" dist/",
"cp:sprites": "cpx \"src/tmp/*.png\" dist/",
"watch:images": "watch \"npm run build:images\" src/public/img",
"watch:sprites": "sprity watch src/tmp \"src/sprite/*.png\" -c ./ -n sprite -t ./src/sprite.less.hbs -s sprite.less --orientation binary-tree -d 1:72 -d 2:192",
"watch:less": "autoless --autoprefix \"last 3 versions\" src/less/ dist/",
"watch:js": "webpack -d --watch --progress src/scripts/main.jsx dist/main.js",
"watch": "npm-run-all -p cp:watch:* watch:*",
import React, { PropTypes } from 'react';
import { camelize } from './';
export default (actionTypes = []) => (Component) => {
return class extends React.Component {
static defaultProps = {
$: PropTypes.func,
dispatch: PropTypes.func,
export const handleLocalActions = (reducers) => {
const reducer = (state, action) => {
if (!action.me) {
return state;
}
const { meta: { type }, payload } = action;
if (!reducers[type]) {
return state;
import React, { PropTypes } from 'react';
export default (thunks = {}) => (Component) => {
return class extends React.Component {
static propTypes = {
dispatch: PropTypes.func,
};
static defaultProps = {
@farism
farism / fractal-modules.js
Created October 9, 2016 18:53
redux-fractal + redux-modules
// Pagination/module.js
import { createModule } from 'redux-modules';
export default createModule({
name: 'pagination',
initialState: {
currentPage: 0,
perPage: 50,
},
transformations: [{
import { combineReducers, createStore } from 'redux';
import { local } from 'redux-fractal';
import R from 'ramda';
const combineModules = modules => {
return modules.reduce((acc, module) => ({
reducers: { ...acc.reducers, [module.name]: module.reducer },
actions: { ...acc.actions, ...module.actions },
}), { actions: {}, reducers: {} });
};
LOKI Build Report
Class: Friar
Level: 39
Two-Handed
Item Utility: 729.0
Build Utility: 739.0
Useable Utility: 728.0
TOA Utility: 465.0
PvE Utility: 0.0
@farism
farism / phoenixdriver.ts
Created February 21, 2017 20:05
phoenix driver
import {Channel, Presence, Socket} from 'phoenix'
import xs, {MemoryStream, Stream} from 'xstream'
interface Options {
params?: object;
}
interface SocketMessage {
event: string;
payload: object;
import {Channel, Presence, Socket} from 'phoenix'
import xs, {MemoryStream, Stream} from 'xstream'
interface Options {
params?: Object;
}
interface PresenceMeta {
name: string;
online_at: number;