Skip to content

Instantly share code, notes, and snippets.

@RB-Lab
RB-Lab / niceCSSdivider
Created May 16, 2014 15:07
css divider like ---------- ⌘ ----------- from <hr/> tag
hr{
margin: 1em 7em;
background: #333;
height: 1px;
border: none;
position: relative;
}
hr:before{
content: "\2318"; /* ⌘ */
position: absolute;
@RB-Lab
RB-Lab / index.js
Last active August 29, 2015 14:05
index.js for node configs
var fs = require('fs');
var path = require('path');
var env = process.env.NODE_ENV || 'development';
var config = JSON.parse(fs.readFileSync(__dirname + '/'+env+'.json'));
config.env = env;
config.root = path.dirname(require.main.filename);
module.exports = config;
function encodeAsUrl_(params){
return Object.keys(params).map(key => key + '=' + params[key]).join('&')
}
function handleResponce_(xhr, cb, errcb){
return function () {
if (4 === xhr.readyState) {
if(xhr.status >= 200 && xhr.status < 400){
cb(xhr);
@RB-Lab
RB-Lab / grid.scss
Created February 10, 2015 20:14
Very simple 12-column grid system in scss
$small: 320px;
*[class^="col-"]{
float: left;
box-sizing: border-box;
@media only screen and (max-width: $small) {
&.not-for-small{
width: 100%;
float: none
}
@RB-Lab
RB-Lab / key-codes.js
Created April 11, 2015 17:45
Common keycodes as CJS module
module.exports = {
ENTER: 13,
ESC: 27,
BACKSPACE: 8,
DELETE: 45,
TAB: 9,
LEFT_ARROW: 37,
UP_ARROW: 38,
RIGTH_ARROW: 39,
@RB-Lab
RB-Lab / theSimpliestModules.js
Last active August 29, 2015 14:22
Synchronous module micro framework.
/**
* @name module
* @global
* @description Synchronous module micro framework.
* Allows to define and require modules with only one variable (module)
* in global scope.
* @exports module
* @example
* module('my-module', function(require, module){
* var lib = require('lib');
// -- Base -- //
// original from https://gist.github.com/amatiasq/2e4344792f28611fa499
function curry(fn, length) {
length = length || fn.length;
return function currified() {
var args = [].slice.call(arguments);
if (args.length === 0)
return currified;
/**
* function sliceRing make circular slice of array
* @param {Array} arr
* @param {Number} start
* @param {Number} length
* @returns {Array}
*/
export default function sliceRing(arr, start, length) {
start = start % arr.length;
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
filename: 'javascript/vendor.[chunkhash].js',
minChunks: module => {
return module.resource &&
module.resource.indexOf(path.resolve(__dirname, '../node_modules')) === 0;
}
})
@RB-Lab
RB-Lab / atom.md
Last active December 11, 2015 16:31

Plugins

  • git-control
  • git-diff-popup
  • git-log
  • merge-conflicts
  • simple-drag-drop-text
  • tab-switcher
  • color-picker
  • editorconfig