Skip to content

Instantly share code, notes, and snippets.

View adityamenon's full-sized avatar

Aditya MP adityamenon

View GitHub Profile
@wenhuizhang
wenhuizhang / distributed_systems_readings.md
Last active May 2, 2024 17:50
distributed systems readings

#Distributed System Course List

##Systems

  • Cornell CS 614 - Advanced Course in Computer Systems - Ken Birman teaches this course. The readings cover more distributed systems research than is typical (which I am in favour of!). In fact, there's barely anything on traditional internal OS topics like filesystems or memory management. There's some worthwhile commentary at the bottom of the page.

  • Princeton COS 518 - Advanced Operating Systems - short and snappy reading list of two papers per topic, covering some interesting stuff like buffering inside the operating system, and L4.

@markgoodyear
markgoodyear / 01-gulpfile.js
Last active May 5, 2023 03:21
Comparison between gulp and Grunt. See http://markgoodyear.com/2014/01/getting-started-with-gulp/ for a write-up.
/*!
* gulp
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev
*/
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
cssnano = require('gulp-cssnano'),
@kapv89
kapv89 / session.js
Created October 15, 2013 22:11
A simple session implementation for angular apps
define(function () {
return [function () {
var keyName = API_KEY_NAME;
var key = localStorage.getItem('sessionKey');
return {
keyName: function () {
return keyName;
},
@kapv89
kapv89 / ajax.js
Created October 15, 2013 22:10
a jquery.ajax based replacement for angular http layer
define(function () {
return [
'$rootScope', '$q', 'session',
function ($rootScope, $q, session) {
var ajax = function (options) {
var deferred = $q.defer();
var success = function (data, status, xhr) {
@kapv89
kapv89 / api.dev
Created September 29, 2013 15:18
nginx api conf
server {
server_name api.foo.dev;
listen 80;
access_log /var/log/nginx/api.foo.dev.access.log;
error_log /var/log/nginx/api.foo.dev.error.log;
root /home/user/Projects/foo/server/api/public;
@kapv89
kapv89 / cors-nginx.conf
Created September 29, 2013 15:08
cors-nginx
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' $http_origin;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,$cors_headers';
add_header 'Access-Control-Expose-Headers' $cors_headers;
# dafuq are these
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';

We are gonna be using php5.5 , so upgrade your systems to that.

  1. http://laravel.com/docs/contributing#coding-guidelines , we follow these, along with PSR-0 and PSR-1.

  2. use Foo (aliasing) etc statements should start from the 3rd line. Each class that needs to be used in a namespace has to be aliased in a separate line.

  3. Aliasing is important. You shouldn't be using more than two Namespace Separators (\) in the code that you right in your classes. Try to restrict the count of those namespace separators to one.

  4. No accessing global namespace (ie, \Foo is not allowed, you need to alias the class Foo via use Foo). The only exception for this is php spl exception classes.

@kapv89
kapv89 / sandBox.js
Last active December 13, 2015 20:18
An untested concept of a sandbox for client side dev
// needs underscore and Backbone.Events( really didn't want to code that stuff up :P)
window.sandBoxFactory = function () {
var vent = _.extend({}, Backbone.Events); // The event aggregator for the sandbox
var communicatorEvents = [];
var broadCasters = {};
var sandBox = {
@JeffreyWay
JeffreyWay / BaseModel.php
Last active March 1, 2020 07:14
To make for clean and readable tests, do your mocking in a base model that your Eloquent models extend.
<?php
class BaseModel extends Eloquent {
public static function shouldReceive()
{
$repo = get_called_class() . 'RepositoryInterface';
$mock = Mockery::mock($repo);
App::instance($repo, $mock);
@mikedfunk
mikedfunk / README.md
Created August 28, 2012 21:17
CodeIgniter Pagination for Twitter Bootstrap

This uses Twitter Bootstrap classes for CodeIgniter pagination.

Drop this file into application/config.