Skip to content

Instantly share code, notes, and snippets.

View msassak's full-sized avatar

Mike Sassak msassak

View GitHub Profile
@josephbuchma
josephbuchma / .spacemacs
Last active February 4, 2018 03:05
My .spacemacs
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration."
(setq-default
;; List of additional paths where to look for configuration layers.
;; Paths must have a trailing slash (i.e. `~/.mycontribs/')
dotspacemacs-configuration-layer-path '()
@loderunner
loderunner / 01-mac-profiling.md
Last active March 17, 2024 04:13
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:

@nox
nox / atkin.erl
Last active December 20, 2015 04:49
Sieve of Atkin in Erlang with a mutable HiPE bitarray. Forgive me, I was bored.
-module(atkin).
-export([primes_smaller_than/1]).
primes_smaller_than(Limit) ->
primes_smaller_than(Limit, sieve(Limit), []).
primes_smaller_than(0, _, Acc) ->
Acc;
primes_smaller_than(N, Bin, Acc) ->
@jasonrudolph
jasonrudolph / 00-about-search-api-examples.md
Last active April 30, 2024 19:21
5 entertaining things you can find with the GitHub Search API
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 3, 2024 16:53
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active April 26, 2024 23:26 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@trey
trey / happy_git_on_osx.md
Last active February 18, 2024 10:46
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"

@jbpros
jbpros / basic.feature
Created May 30, 2011 14:51
Cucumber implementation-independent feature ideas
Feature: Basic feature execution
In order to do BDD
As a cucumber afficionado
I want to run basic cucumber features
# 1. Not abstract enough: first step is language dependent
Scenario: Simple flat steps
Given the following step definition:
"""
When(/a step passes/, function() {
@mfdela
mfdela / fiber.rb
Created February 13, 2011 00:44
Ruby fiber benchmark
#!/usr/bin/ruby1.9
require 'fiber'
require 'benchmark'
class Ring
attr_reader :id
attr_accessor :attach
def initialize(id)