Skip to content

Instantly share code, notes, and snippets.

View voxpelli's full-sized avatar

Pelle Wessman voxpelli

View GitHub Profile
@KittyGiraudel
KittyGiraudel / SassMeister-input.scss
Last active August 29, 2015 13:57
Generated by SassMeister.com.
// ----
// libsass (v3.1.0-beta)
// ----
/// Power function
/// @param {Number} $x
/// @param {Number} $n
/// @return {Number}
@function pow($x, $n) {
$ret: 1;

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
@hugowetterberg
hugowetterberg / brew_mamp.markdown
Created June 21, 2010 07:16
How to get a working XAMP stack with brew
build:
@echo "Combining files ..."
@cat \
js/dep/jquery.easing.js \
js/dep/jquery.jsonp.js \
js/dep/json2.js \
js/dep/toolbox.expose.js \
js/lib/jquery.transloadit2.js > build/jquery.transloadit2.js
@echo "Compiling with Closure REST API ..."
@curl \

Apps

<?php
class ServicesContext implements ArrayAccess {
protected $handlers;
protected $namespaces;
private $values = array();
function __construct($handlers = array(), $namespaces = array()) {
$this->handlers = $handlers;
$this->namespaces = $namespaces;
<?php
/**
* Make MySQL correctly sort nodes on swedish sites
*/
function hook_install() {
db_query("ALTER TABLE {node} MODIFY
title VARCHAR(255)
CHARACTER SET utf8
COLLATE utf8_swedish_ci");
}
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title></title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<style>
ul {
overflow: hidden;
width: 150px;
height: 70px;

Use the post-receive in a repo on eg. your testing or production server. Create a git-repo on the server for the code you want to run there and add it as a remote to your local checkout of your project repo. Whenever you want to deploy you push to the git repo on the server and with the below script as the post-receive hook on the project the server will automatically update with the new code.

Originally described in a now probably slightly outdated blog post: http://blogs.goodold.se/tech/2009/06/26/git-workflow-going-live/

To use this hook the git repository on the server should have another branch than its master branch checked out. The git repo on the server can be an entirely new one and doesn't have to be a checkout of your project repo. Creating an entirely new repo involves some fiddling with temporary commits and force pushing though - nothing complicated, but perhaps not something that everyone is used to be doing.

@al3x
al3x / gist:967060
Created May 11, 2011 18:49 — forked from 3n/gist:967051
A "blog" "post" about asynchronous script loading and MooTools.

A lot of talk at JSConf was on the use of modules: AMD, CommmonJS, or otherwise. Since the server-side JavaScript world has this mostly covered, a more heavily discussed topic was bringing the joys of modularity to the client-side. This, of course, is a tricky thing to do since loading scripts requires some sort of relatively slow and possibly asynchronous network request. How does one balance the issues of perceived latency, JS execution (UI blocking), page weight, and code tidiness? I spent some time looking into this and here's my first stab at a solution (no I'm not releasing some open source project shut up).

Real quick: if you don't agree that splitting files to do asynchronous loading is a good idea you should read more.

I code most of my projects in MooTools (including my current project, BankSimple, so modularity is a given for me. MooTools is