Skip to content

Instantly share code, notes, and snippets.

View fouad's full-sized avatar
🔐
aGVsbG8gd29ybGQ

Fouad Matin fouad

🔐
aGVsbG8gd29ybGQ
View GitHub Profile

Keybase proof

I hereby claim:

  • I am fouad on github.
  • I am fouadmatin (https://keybase.io/fouadmatin) on keybase.
  • I have a public key ASAkOioQgeMr3I8gdVjTBpA88-QUMOp4VHUw5qHEXmc4yAo

To claim this, I am signing this object:

// Shorten strings over 40 characters
//
// input = FirstTwelveCharactersAndTheLastFifteen
// output = FirstTwelvec...dTheLastFifteen
function shorten(str) {
return str.replace(
/[^"]{40,}/g,
match => `${match.substring(0, 12)}...${match.substring(match.length - 15)}`
)
var fireworks = require('fireworks')
setInterval(() => {
fireworks({
x: window.innerWidth / 2,
y: window.innerHeight / 2,
colors: ["#cc3333", "#4CAF50", "#81C784"]
})
}, 1000)
@fouad
fouad / cloudflare.json
Created October 12, 2015 06:42
Purge CloudFlare cache on deploy
{
"email": "me@email.com",
"zone": "CLOUDFLARE_ZONE",
"token": "CLOUDFLARE_TOKEN"
}
// sign up flow
var ie = yield launch("ie", 8, "http://localhost:8080");
yield robot.focus(ie);
yield robot.find({
type: "button",
text: "sign up"
}).click();
Verifying I am +fouad on my passcard. https://onename.com/fouad
@fouad
fouad / mesh-model.js
Last active August 29, 2015 14:18 — forked from crcn/mesh-model.js
// model(db, query)
var model = mesh.model(db, { _id: "ball" });
// watch entire model
model.watch(function() {
});
// watch specific props (delta)
model.watch({active: true}, function() {
@fouad
fouad / chatroom.js
Last active August 29, 2015 14:17 — forked from crcn/chatroom.js
var crudlet = require("crudlet");
var localstore = require("crudlet-local-storage");
var pubnub = require("crudlet-pubnub");
var http = require("crudlet-http");
var localdb = localstore();
var httpdb = http()
var pubdb = pubnub();
var allDbs = crudlet.parallel(httpdb, pubdb);
var db = crudlet(localdb());
var peopleDb = db.child({ collection:"people", localdb: {limit: 10} });