Skip to content

Instantly share code, notes, and snippets.

View d4tocchini's full-sized avatar

Dan Tocchini IV d4tocchini

View GitHub Profile
@d4tocchini
d4tocchini / script.coffee
Created February 1, 2012 22:11
Cass Tests
$ ->
# run quaddemo?
#runit()
global = window
BP = (options) ->
console.log options
alert options
ERROR = (options) ->
@d4tocchini
d4tocchini / D4-001.md
Created April 3, 2012 01:18
Overconstrained Mailing List

I've already communicated this with you, Greg & Alex, but I thought I'd shoot the mailing list a summary...

Heads-up: code snippets are coffeescript

My focus has been on high-level declaration of constraints, not so much solver API. My API goals thus far:

  • Chain-able, ie. 100 <= w <= 1000 <= w2...
  • Close-as-possible resemblance to natural forms of equality and inequality equations. This also makes the Ometa language parsing pretty straightforward.
  • Higher-ordered constraint objects that contain constraint primitives. Maybe current c.Constraint should be c.ConstraintPrimitive? A chained constraint equation would contain many constraint primitives. This would also allow subclassing of constraints that internally setup many constraint primitives.
  • Convention & hooks for subclassing core Constraint object for implementing custom relationships such as "inside", "left-of", etc... I imagine a plugin-like eco-system, where the API can expand to include W3C's grid-layout templates and [Apples Visu
{{view Th.PageLayout id="home-page-layout" pageTemplates="[pageA,pageB]" contentBinding="App.homeTiles"}}

Facbeook Graph API, what you need to know

The hello-world basics as of 9/20/12

Which is better, FQL or the Facebook Graph API?

Of the two ways to query, which is better? The answer is complicated... In the end, the Facebook Graph API is my preferred. It is simpler, the returned data is better formatted and its newer version. FQL can do more, but not much more since the addition Field Expansions, which were just added the end of last month!

What is the query for the Facebook Home Feed ?

Post

  • plus

  • video url

  • call to action What is the most important action you want people to do on your site? Buy now? Sign up? Learn more? Whatever it is, you need a prominent link that drives people to accomplish that action - you need a Call to Action!

  • crowdfunding campaign

  • goal

handleMutations: (mutations) =>
for m in mutations
for node in m.removedNodes
doSomethingToRemoved node
for node in m.addedNodes
doSomethingToAdded node
if m.type is "characterData" or m.type is "attributes" or m.type is "childList"
doSomethingWithType(m)
observer = new MutationObserver handleMutations
observer.observe(document.getElementById('graph'), {subtree: true, childList: true, attributes: false, characterData: false})
@d4tocchini
d4tocchini / selectorparser
Last active August 29, 2015 14:03
selector parser
{
var p;
p = this;
p.toString = function (x) {
if (typeof x === "string") {return x}
if (x instanceof Array) {return x.join("")}
return ""
}
@d4tocchini
d4tocchini / 01 source VFL.css
Last active August 29, 2015 14:06
VFL to CCSS
@h |- (.box)-10-... - (#box2) (#box3)-| gap([gap]) in(#container) {
width: == &:next[width]; // replacement for chain-width()
top: == ::window[top]; // replacement for chain-top(::window[top])
}
$.section class:"3pronged #{@classes.split(' ')}"
variant '3posts_w_media'
for post in @posts.eat(3)
$.article
$.h1 post.h1.eat(1)
$.h2 post.h2.eat(1)
$.text post.text.eat(1)
$.image post.media.eat(1).eat(1, type:'image')
@d4tocchini
d4tocchini / fluid imac with shine.css
Created September 27, 2014 23:42
border-image magic
.imac {
/* apply imac image as fluid border image around figure */
border-width: 34px 34px 163px 34px;
-moz-border-image: url("../img/border/border-mac-screen-800x608.png") 34 34 163 34 repeat;
-webkit-border-image: url("../img/border/border-mac-screen-800x608.png") 34 34 163 34 repeat;
-o-border-image: url("../img/border/border-mac-screen-800x608.png") 34 34 163 34 repeat;
border-image: url("../img/border/border-mac-screen-800x608.png") 34 34 163 34 fill repeat;
margin-left: -34px !important;
box-sizing: content-box !important;
}