Skip to content

Instantly share code, notes, and snippets.

View nissoh's full-sized avatar
🎯
Focusing

itburnz nissoh

🎯
Focusing
  • 2501
  • Sea of information
View GitHub Profile
@nissoh
nissoh / index.js
Last active August 29, 2015 14:24
requirebin sketch
var most = require('most');
var DROP = 0, GRAB = 1, DRAG = 2;
// The thing we want to make draggable
var playground = document.querySelector('.playground');
var draggable = document.querySelector('.draggable');
var dragOffset = {};
// A higher-order stream (stream whose events are themselves streams)
@nissoh
nissoh / streamDecorator
Created May 10, 2015 09:42
Most & React - Stream ES7 decorator.
import React, { Component } from 'react';
import excEnv from 'react/lib/ExecutionEnvironment';
import most from 'most'
export default function Stream(streams) {
return DecoratedComponent => {
class StreamComponent extends Component {
constructor(props) {
@nissoh
nissoh / index.js
Last active June 30, 2024 15:10
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var most = require('most');
var endlessStream = most.create( function(add, end, error) {
function count(int) {
add(int);
int++;
setTimeout(count, 1000, int);
@nissoh
nissoh / ng-grid-rtl.css
Created January 25, 2014 07:28
ng-grid css
.ngGrid {
}
.ngGrid input {
vertical-align: top;
}
.ngGrid.unselectable {
-moz-user-select: none;
@nissoh
nissoh / ng-grid-rtl.js
Last active January 4, 2016 11:09
ng-grid rtl
/***********************************************
* ng-grid JavaScript Library
* Authors: https://github.com/angular-ui/ng-grid/blob/master/README.md
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
* Compiled At: 07/06/2013 13:50
***********************************************/
(function(window, $) {
'use strict';
// the # of rows we want to add to the top and bottom of the rendered grid rows
var EXCESS_ROWS = 6;
@nissoh
nissoh / dabblet.css
Created July 16, 2013 17:53
Scrolling shadows by @kizmarh and @LeaVerou
/**
* Scrolling shadows by @kizmarh and @leaverou
* Only works in browsers supporting background-attachment: local; & CSS gradients
* Degrades gracefully
*/
html {
background: white;
font: 120% sans-serif;
}
.slideFade {
position: relative;
height: 0;
opacity: 0;
overflow: hidden;
@include transition(height .35s ease);
}
.slideFade.in {
opacity: 1;
height: auto;

Using Yeoman and Jade

Getting started

  • Make sure you have yo installed: npm install -g yo
  • Run: yo webapp
  • Install grunt-contrib-jade: npm install grunt-contrib-jade --save-dev

Customization

_.extend Backbone.Validation.callbacks,
valid: (view, attr, selector) ->
control = view.$('[' + selector + '=' + attr + ']')
group = control.parents(".control-group")
group.removeClass("error")
if control.data("error-style") == "tooltip"
# CAUTION: calling tooltip("hide") on an uninitialized tooltip
# causes bootstraps tooltips to crash somehow...
control.tooltip "hide" if control.data("tooltip")
@nissoh
nissoh / My-lobby.html
Created May 15, 2012 14:06
HTML5 meta
<!DOCTYPE HTML>
<html lang="">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="css/style.css">