View simple_form_bootstrap3.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inputs = %w[ | |
CollectionSelectInput | |
DateTimeInput | |
FileInput | |
GroupedCollectionSelectInput | |
NumericInput | |
PasswordInput | |
RangeInput | |
StringInput | |
TextInput |
View vscode-settings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"window.zoomLevel": -1, | |
"window.title": "${activeEditorLong}${separator}${rootName}", | |
"workbench.iconTheme": "vscode-great-icons", | |
"editor.tabSize": 2, | |
"files.trimTrailingWhitespace": true, | |
"emmet.syntaxProfiles": { | |
"javascript": "jsx" | |
}, | |
"files.associations": { |
View createHierarchy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const TOPIC = "topic" | |
const CATEGORY = "category" | |
const typeName = levels => (levels >= 3 ? TOPIC : CATEGORY) | |
const createNode = ({ perLevel, levels, remainingLevels }) => { | |
if (remainingLevels === 0) return { type: TOPIC, children: [] } | |
return { | |
type: typeName(levels - remainingLevels), |
View asyncMessage.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function asyncMessage(msg) { | |
let deferred | |
const onMessage = function (msg) { | |
if (deferred) { | |
deferred.resolve(msg) | |
deferred = null | |
} | |
} |
View vanillajs-ajax.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://stackoverflow.com/questions/8567114/how-to-make-an-ajax-call-without-jquery/18078705#18078705 | |
var ajax = {}; | |
ajax.xhr = function() { | |
try { | |
return new ActiveXObject('Msxml2.XMLHTTP') | |
} catch (e1) { | |
try { | |
return new ActiveXObject('Microsoft.XMLHTTP') | |
} catch (e2) { |
View webpack.dev.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run like this: | |
// cd client && webpack-dev-server --config webpack.development.config.js --hot --colors --progress --inline | |
var config = require("./webpack.base.config"); | |
var webpack = require("webpack"); | |
var path = require("path"); | |
var autoprefixer = require('autoprefixer'); | |
var precss = require('precss') | |
var autoprefixer = require('autoprefixer'); |
View redux-utils.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import R from 'ramda' | |
/* | |
Example | |
createAsyncActionType('LOGIN') | |
will return an object | |
{ |
View sidekiq_colorful_logger.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sidekiq.logger.formatter = proc do |severity, time, context, message| | |
colorized_time = "#{time.utc.iso8601}".colorize(:cyan) | |
case severity | |
when 'INFO' | |
colorized_severity = "#{severity}:".colorize(:green) | |
"#{colorized_time} #{Process.pid} TID-#{Thread.current.object_id.to_s(36)}#{context} #{colorized_severity} #{message}\n" | |
when 'ERROR' | |
colorized_severity = "#{severity}:".colorize(:red) | |
"#{colorized_time} #{Process.pid} TID-#{Thread.current.object_id.to_s(36)}#{context} #{colorized_severity} #{message}\n" |
View gist:0df491c4c144c48bae46
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./scripts/build -- src/pick.js src/equals.js src/isEmpty.js src/curry.js src/omit.js src/merge.js src/append.js > dist/ramda.custom.js |
View endpoint.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fetch from 'isomorphic-fetch' | |
import { camelizeKeys } from 'humps' | |
import R from 'ramda' | |
import { normalize, arrayOf } from 'normalizr' | |
import Path from 'path-parser' | |
import { encode } from 'querystring' | |
import pluralize from 'pluralize' | |
import { playlistSchema } from 'schemas' | |
import { assocUid, mapValues } from 'utils/helpers' | |
import cuid from 'cuid' |
NewerOlder