Skip to content

Instantly share code, notes, and snippets.

View amejiarosario's full-sized avatar
🎯
Think big, start small, learn fast!

Adrian Mejia amejiarosario

🎯
Think big, start small, learn fast!
View GitHub Profile
@amejiarosario
amejiarosario / dotfiles_installer.sh
Last active October 6, 2015 10:07
Dotfile installer - Let's automate the boring process for awesome results
# curl -k https://gist.github.com/raw/2976697/a2e9f2ff292a1fe5ceb7ddb05900f73a249abcdb/dotfiles_installer.sh | sudo sh
# create directory
cd ~/
mkdir gists
cd gists
# download git stuff
git clone git://gist.github.com/2931603.git gitconfig
ln -s ~/gists/gitconfig/.gitconfig ~/.gitconfig
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 4, 2025 15:00
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@amejiarosario
amejiarosario / .gitconfig
Created June 14, 2012 17:19
Git config
[user]
email = [email protected]
name = Adrian Mejia
[color]
ui = auto
interactive = true
[alias]
ci = commit
di = diff --color-words
@amejiarosario
amejiarosario / aliases.sh
Last active October 6, 2015 03:47
aliases
# bash
alias b='vi ~/.bash_login'
alias u='source ~/.bashrc'
#ls
alias l='ls -CF'
alias ll='ls -alFc'
alias la='ls -A'
alias lt='ls -lart'
@GUI
GUI / install_vagrant_sudoers.sh
Created June 3, 2012 19:13
Allow Vagrant sudo-access without password for NFS-setup (for OS X)
#!/bin/bash
# Script for placing sudoers.d files with syntax-checking
# Making a temporary file to contain the sudoers-changes to be pre-checked
TMP=$(mktemp -t vagrant_sudoers)
cat /etc/sudoers > $TMP
cat >> $TMP <<EOF
# Allow passwordless startup of Vagrant when using NFS.
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/su root -c echo '*' >> /etc/exports
@jhclark
jhclark / latency.txt
Created May 31, 2012 19:58 — forked from jboner/latency.txt
Latency numbers every programmer should know
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 1 MB sequentially from memory 250,000 ns 0.25 ms
Round trip within same datacenter 500,000 ns 0.5 ms
Read 1 MB sequentially from SSD 1,000,000 ns 1 ms 4X memory
@dillera
dillera / rbenv-lucid
Last active October 5, 2015 05:58
rbenv for ubuntu lucid
#!/bin/bash
set -e # exit on error
### README
# * installs your desired ruby versions using rbenv
# ** including openssl (needed by bundler)
# ** including sqlite (probably needed for rails apps)
#
# Before you start:
# * put ssh-keys in place
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@amejiarosario
amejiarosario / _flash.html.erb
Created April 22, 2012 20:13 — forked from potomak/_flash.html.erb
Rails flash messages using Twitter bootstrap
<% [:notice, :error, :alert].each do |level| %>
<% unless flash[level].blank? %>
<div class="alert-message <%= flash_class(level) %>">
<a class="close" href="#">×</a>
<%= content_tag :p, flash[level] %>
</div>
<% end %>
<% end %>
@aheckmann
aheckmann / storeImgInMongoWithMongoose.js
Created April 17, 2012 19:14
store/display an image in mongodb using mongoose/express
/**
* Module dependencies
*/
var express = require('express');
var fs = require('fs');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
// img path