Skip to content

Instantly share code, notes, and snippets.

Diego E. Salazar DiegoSalazar

View GitHub Profile
View Effective_Engineer.md

FWIW: I'm not the author of the content presented here (which is an outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

View Getting-Cheat-Sheet.md

Git Cheat Sheet

Visit my blog.

Commands

Getting Started

git init

or

View screen_cheatsheet.markdown

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r <session_name>
@joshnuss
joshnuss / prisoners_dilemma.exs
Last active Dec 26, 2015
WIP Prisoner's Dilemma Simulation
View prisoners_dilemma.exs
# Prisoner's Dilemma
defmodule Scoreboard do
use GenServer.Behaviour
def start do
:gen_server.start_link({:local, :scoreboard}, __MODULE__, [], [])
end
def init do
{:ok, []}
@iambibhas
iambibhas / scopes.txt
Last active Jul 20, 2020
Sublime Text 2: Snippet scopes
View scopes.txt
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
@jakeonrails
jakeonrails / Ruby Notepad Bookmarklet
Created Jan 29, 2013
This bookmarklet gives you a code editor in your browser with a single click.
View Ruby Notepad Bookmarklet
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
@jwo
jwo / mysql.database.yml
Last active Jul 31, 2020
Sample config/database.yml from Rails. Postgres, MySQL, and SQLite
View mysql.database.yml
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
@DiegoSalazar
DiegoSalazar / validate_credit_card.js
Last active Jul 31, 2020
Luhn algorithm in Javascript. Check valid credit card numbers
View validate_credit_card.js
// Takes a credit card string value and returns true on valid number
function valid_credit_card(value) {
// Accept only digits, dashes or spaces
if (/[^0-9-\s]+/.test(value)) return false;
// The Luhn Algorithm. It's so pretty.
let nCheck = 0, bEven = false;
value = value.replace(/\D/g, "");
for (var n = value.length - 1; n >= 0; n--) {
View ChatServer.rb
require 'socket'
module EventEmitter
def _callbacks
@_callbacks ||= Hash.new { |h, k| h[k] = [] }
end
def on(type, &blk)
_callbacks[type] << blk
self
@trcarden
trcarden / gist:3295935
Created Aug 8, 2012
Rails 3.2.7 SSL Localhost (no red warnings, no apache config)
View gist:3295935
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
You can’t perform that action at this time.