Skip to content

Instantly share code, notes, and snippets.

View prayagupa's full-sized avatar
💭
Neta

Prayag prayagupa

💭
Neta
View GitHub Profile
@loderunner
loderunner / 01-mac-profiling.md
Last active October 24, 2024 20:57
Profiling an application in Mac OS X

Profiling an application in Mac OS X

Finding which process to profile

If your system is running slowly, perhaps a process is using too much CPU time and won't let other processes run smoothly. To find out which processes are taking up a lot of CPU time, you can use Apple's Activity Monitor.

The CPU pane shows how processes are affecting CPU (processor) activity:

@pnommensen
pnommensen / gist:707b5519766ba45366dd
Last active September 14, 2024 01:23
Ghost CMS with NGINX for Maximum Performance

Full blog post can be found here: http://pnommensen.com/2014/09/07/high-performance-ghost-configuration-with-nginx/

Ghost is an open source platform for blogging founded by John O'Nolan and Hannah Wolfe. It's a node.js application and therefore works great in conjunction with nginx. This guide will will help you create a high performance nginx virtual host configuration for Ghost.

"Don't use #nodejs for static content" - @trevnorris. If #nginx isn't sitting in front of your node server, you're probably doing it wrong.

— Bryan Hughes (@nebrius) August 30, 2014
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

The node.js application runs on a port on your server

@crosbymichael
crosbymichael / mesos-ubuntu-install.sh
Created July 9, 2014 18:43
Install mesos on ubuntu 14.04
#!/bin/bash
set -e
apt-get install -y curl python-setuptools python-pip python-dev python-protobuf
# zookeeper
apt-get install -y zookeeperd
echo 1 | dd of=/var/lib/zookeeper/myid
@timyates
timyates / forceOverrideTraits.groovy
Last active October 21, 2015 04:25
Messing with groovy traits
// Bad example of @ForceOverride... enjoy! (?)
import groovy.transform.*
class BasicIntQueue extends LinkedList<Integer> {
Integer get() {
this.poll()
}
void put( Integer x ) {
@jdewit
jdewit / vim74_lua
Last active January 30, 2024 04:57
Installing vim 7.4 with lua on Ubuntu 12.04
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get build-dep vim-gnome
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
sudo rm -rf /usr/local/share/vim
sudo rm /usr/bin/vim
/* Merge sort in C */
#include<stdio.h>
#include<stdlib.h>
// Function to Merge Arrays L and R into A.
// lefCount = number of elements in L
// rightCount = number of elements in R.
void Merge(int *A,int *L,int leftCount,int *R,int rightCount) {
int i,j,k;
@anderssonfilip
anderssonfilip / gist:9528419
Last active August 29, 2015 13:57
Spray Client example
// Akka Actor system
import akka.actor.ActorSystem
// HTTP related imports
import spray.http.{ HttpRequest, HttpResponse }
import spray.client.pipelining.{ Get, sendReceive }
// Futures related imports
import scala.concurrent.Future
import scala.util.{ Success, Failure }

Software projects built on Mesos

PaaS and Long Running Services

  • Aurora is a service scheduler that runs on top of Mesos, enabling you to run long-running services that take advantage of Mesos' scalability, fault-tolerance, and resource isolation.
  • Marathon is a private PaaS built on Mesos. It automatically handles hardware or software failures and ensures that an app is "always on".
  • SSSP is a simple web application that provides a white-label "Megaupload" for storing and sharing files in S3.

Big Data Processing

@tychobrailleur
tychobrailleur / gist:8753725
Last active August 29, 2015 13:55
Emacs Lisp experimentations
(defun project-euler-1 (n)
"Implementation for Project Euler 1"
(let ((sum 0))
(dotimes (i n)
(if (or (= 0 (% i 3)) (= 0 (% i 5)))
(setq sum (+ sum i))))
sum))
(project-euler-1 1000)
(defvar memoize (make-hash-table :test 'equal))
(defproject sutime-clojure "0.1.0-SNAPSHOT"
:description "Wrapper around the time functionality in Stanford NLP Suite"
:url "https://github.com/shriphani/sutime-clojure"
:license {:name "MIT License"
:url "http://opensource.org/licenses/MIT"}
:dependencies [[org.clojure/clojure "1.4.0"]
[edu.stanford.nlp/stanford-corenlp "1.3.4"]
[edu.stanford.nlp/stanford-corenlp "1.3.4" :classifier "models"]
[clj-time "0.5.0"]]
:jvm-opts ["-Xmx2000M"]