Skip to content

Instantly share code, notes, and snippets.

@digitalicarus
digitalicarus / .jshintrc
Created December 5, 2012 15:59 — forked from haschek/.jshintrc
JSHint Configuration, Strict Edition
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("react"));
else if(typeof define === 'function' && define.amd)
define(["react"], factory);
else if(typeof exports === 'object')
exports["ReactMotion"] = factory(require("react"));
else
root["ReactMotion"] = factory(root["React"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {
@digitalicarus
digitalicarus / fiddle.css
Last active November 22, 2015 00:44
React Animation: Card Flip
.deck-component {
perspective: 1000px;
}
.card-component {
position: relative;
display: inline-block;
cursor: pointer;
width: 50px;
height:50px;
margin: 10px;
@digitalicarus
digitalicarus / fiddle.css
Last active November 23, 2015 15:38
React Animation: DOM Enter Exit Popover
html *, body * {
margin: 0;
padding: 0;
font-family: Verdana, arial;
}
header {
background-color: #dcdcdc;
box-shadow: 0 1px 4px #666;
height: 40px;
line-height: 40px;
function parseQueryString(altStr) {
var s = altStr || window.location.search.substring(1)
, p = s.split("&")
, t = []
, q = {}
, i = 0
;
for(i = 0; i < p.length; i++) {
t = p[i].split("=");
@digitalicarus
digitalicarus / gist:4652503
Created January 28, 2013 02:35
lander "sprite"
this.parts = [
{
//head
points: [-1,2,-3,3,-3,6,-1,7,1,7,3,6,3,3,1,2,-1,2],
color: "#F00"
},
{
//body
points: [-3,2,3,2,3,-1,-3,-1,-3,2]
},
@digitalicarus
digitalicarus / fiddle.css
Last active December 17, 2015 07:59
Test JSFiddle Gist integration
aside {
background: green;
color: white;
}
@digitalicarus
digitalicarus / gist:5967234
Last active December 19, 2015 14:09
| prettyPrintJSON
curl http://freegeoip.net/json/ | node -e "d='';s=process.stdin;o=process.stdout;j=JSON;s.on('data',function(c){d+=c;});s.on('end',function(){d=j.parse(d); console.log(j.stringify(d,null,30))});"
@digitalicarus
digitalicarus / example.js
Last active December 19, 2015 20:19
recursively execute on an organized nested object where sub objects are identified by '__value' member in a 'relationships' array. Also filter, map and persist opts. TODO: make relationships member a generic option as well as the __value member.
doSomethingGood()
.then(function (tree) {
// filter and print members with indentation, par example
return execObj(tree, {
exec: function (obj, opts) {
var attrs = obj.someAttrArray;
if (attrs) {
attrs = attrs.filter(function (item) {
return attr.type.match(/wicked|bitchin/i);
});
@digitalicarus
digitalicarus / flatter.js
Last active December 22, 2015 04:48
flatter
function flatter (obj, match, replaceWhat, replaceWith) {
var replace = (replaceWhat && replaceWhat instanceof RegExp && typeof replaceWith === 'string')
, tmp = null // description - a tmp variable
;
function getJuicyObject (obj) {
var children = {}
, juicyChildren = {}
;