Skip to content

Instantly share code, notes, and snippets.

View SyntaxStacks's full-sized avatar

John Lozano SyntaxStacks

View GitHub Profile
@SyntaxStacks
SyntaxStacks / WhatADrag
Last active December 12, 2015 02:38
Simple Dragging between multiple containers
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>droppable demo</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css">
<style>
.draggable {
width: 100px;
height: 20px;
@SyntaxStacks
SyntaxStacks / filter.html
Last active December 23, 2015 09:29
Photobooth Filter Selection
<html>
<head>
<title>photobooth</title>
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
</head>
<body>
<div class="container">
<div class="row-fluid">
<span>Step 1</span>
<img src='http://placehold.it/125x125&text=lomo' onClick='setFilter("lomo")'>
function sedReplace () {
if [ -z "$1" ] || [ -z "$2" ]
then
echo "\nUsage: sedReplace <path> <sed_string>\nsedString example: \"s/replace_this/with_that/g\"\n"
return 1
fi
eval "find $1 -type f -exec sed -i '' '$2' {} \;"
return 0
}
minified:
var n=9;for(var i=1;i<n*2;i++){for(var s=n-(Math.abs(i-n)),k=s-1;k>0;k--){s=[k,s,k].join("");}console.log(new Array(Math.abs(i-n)+2).join(" ")+s);}
146 characters
Clean:
var num = 9;
for(var i = 1; i < num*2; i++ ) {
var seq = num-(Math.abs(i-num));
module.js
```
module.exports = function () {
return {
name: 'default',
set: function (name) {
this.name = name;
},
...
};