Skip to content

Instantly share code, notes, and snippets.

View leftieFriele's full-sized avatar

Espen Dalløkken leftieFriele

View GitHub Profile
$(document).ready(function(){
if(!("WebSocket" in window)) {
alert("Sorry, the build of your browser does not support WebSockets. Please use latest Chrome or Webkit nightly");
return;
}
ws = new WebSocket("ws://localhost:8080/");
ws.onmessage = function(evt) {
data = eval("(" + evt.data + ")");
var p = $("<div class='tweet' style='display:none'><div class='content'><a class='main-screenname' href='http://www.twitter.com/" + data.user.screen_name + "/status/" + data.id + "' target='_blank'>" + data.user.screen_name + "</a> " + data.text + "</div></div>");
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@textarcana
textarcana / bamboo-plato.sh
Last active December 25, 2015 16:49
How to run Plato in Bamboo.
#!/usr/bin/env bash
# load history -- necessary because Bamboo runs a "git clean" on the build directory
cp -r /opt/plato-report .
plato -r -d plato-report \
-l .jshintrc \
-t "My Project" \
-x '(jquery|min.js|libs/(backbone|underscore|require))' \
path/to/my_project
/*
This is an EXAMPLE gulpfile.js
You'll want to change it to match your project.
Find plugins at https://npmjs.org/browse/keyword/gulpplugin
*/
var gulp = require('gulp');
var uglify = require('gulp-uglify');
gulp.task('scripts', function() {
// Minify and copy all JavaScript (except vendor scripts)
@lukehoban
lukehoban / es6features.md
Last active December 6, 2019 01:50
ECMAScript 6 Features

Note: Up to date version now at https://github.com/lukehoban/es6features

ECMAScript 6

Introduction

ECMAScript 6 is the upcoming version of the ECMAScript standard. This standard is targetting ratifcation in December 2014. ES6 is a significant update to the language, and the first update to the language since ES5 was standardized in 2009. Implementation of these features in major JavaScript engines is underway now.

See the draft ES6 standard for full specification of the ECMAScript 6 language.

ES6 includes the following new features:

Anivia

Anivia is Walmart's mobile analytics platform. It collects user-interaction metrics from mobile devices -- iPhone, iPad, Android, and mWeb. It also processes logging and other metrics from a bunch of mobile services. Anivia allows the business to have real-time insight and reporting into what is going on in the mobile business and provides vital capabilities for developers and ops folks to monitor the health of their services.

Anivia is built on Node.js, Hapi, RabbitMQ, and a multitude of downstream systems including Splunk and Omniture. Anivia is taking in 7,000 events per second on average (as of this writing), which after some fan-out and demuxing comes out to around 20,000 messages per second in flight. These rates are expected to soar leading up to and including Black Friday. The platform has grown in recent months to over 1,000 node processes spanning multiple data centers, gaining features such as link resiliency in the process.

A few of Anivia's functionalities

  • __Timestamp Correc
@phated
phated / gulpfile.js
Last active April 19, 2018 06:36
Non-misinformed gulp browserify usage
'use strict';
var gulp = require('gulp');
var browserify = require('browserify');
gulp.task('js', function(){
return browserify('./entry.js', { debug: true, transform: ['reactify']})
.bundle().pipe(process.stdout);
});
@captainsafia
captainsafia / mac_dev_setup.sh
Created August 14, 2018 01:06
A set of commands I use to configure my Mac for development
# Create a global gitignore for macOS
cat https://raw.githubusercontent.com/github/gitignore/master/Global/macOS.gitignore >> ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global
# Send screenshots to a directory that isn't the desktop
mkdir -p ~/Screenshots
defaults write com.apple.screencapture location ~/Screenshots
# Show all hidden files (like dotfiles)
defaults write com.apple.finder AppleShowAllFiles YES; killall Finder;