Skip to content

Instantly share code, notes, and snippets.

@sayar
sayar / yammer-group-download-all-images.js
Last active Nov 28, 2016 — forked from Saturate/yammer-group-download-all-files.js
Download all files in a Yammer.com group. You have to enable popups. Only tested in chrome.
View yammer-group-download-all-images.js
/*
# How to use:
1. Navigate to the files tab (https://www.yammer.com/COMPANY/groups/GROUP/uploaded_files)
2. Press F12.
3. Paste script in console and run it.
4. Enjoy downloading files!
# Not working?
1. Enable popups
@sayar
sayar / app.js
Created Jun 5, 2016
Emotion API Node.js Sample Code
View app.js
var request = require('request');
request({
method: 'POST',
url: 'https://api.projectoxford.ai/emotion/v1.0/recognize',
headers: {
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': 'PUT KEY HERE'
},
body: JSON.stringify({
@sayar
sayar / memory_leak.html
Created Sep 16, 2015
FITC - Advanced JavaScript Debugging
View memory_leak.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Memory Leak</title>
<meta name="author" content="@ramisayar">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" integrity="sha256-MfvZlkHCEqatNoGiOXveE8FIwMzZg4W85qfrfIFBfYc= sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
@sayar
sayar / app.js
Last active Aug 29, 2015
FITC - What's New in ES6 for Web Devs - Sample code from my presentation
View app.js
'use strict';
// app.js
import * as math from "math";
alert("2π = " + math.add(math.pi, math.pi));
@sayar
sayar / server.js
Created Mar 22, 2015
Hands-on: Build a Node.js-powered chatroom web app | Part 1: Introduction to Node.js
View server.js
var http = require('http');
var port = process.env.port || 1337;
http.createServer(function (req, res) {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Hello World\n');
}).listen(port);
@sayar
sayar / filter.css
Created Mar 13, 2015
Standard CSS3 Filters Example
View filter.css
img {
filter: grayscale(50%) opacity(10%);
}
@keyframes filter-animation {
0% {
filter: opacity(0);
}
50% {
filter: opacity(100%);
View backbone_pushstate_router.js
// Use absolute URLs to navigate to anything not in your Router.
// Only need this for pushState enabled browsers
if (Backbone.history && Backbone.history._hasPushState) {
// Use delegation to avoid initial DOM selection and allow all matching elements to bubble
$(document).delegate("a", "click", function(evt) {
// Get the anchor href and protcol
var href = $(this).attr("href");
var protocol = this.protocol + "//";