I hereby claim:
- I am reisub on github.
- I am dino_kovac (https://keybase.io/dino_kovac) on keybase.
- I have a public key ASDjRLKia8PlTVhq4TrhoXoDvU1OEHEFKL1qz5t9TyuPGgo
To claim this, I am signing this object:
| #! /usr/local/bin/ruby | |
| # coding: utf-8 | |
| # -------------------------------------- | |
| # Check a prime number | |
| # -------------------------------------- | |
| def is_prime(n) | |
| res = (2..Math.sqrt(n)).any? { |i| n % i == 0 } | |
| puts "#{n}: #{res || n == 1 ? '-----' : "PRIME"}" | |
| end |
| # Steps to build and install tmux from source. | |
| # Takes < 25 seconds on EC2 env [even on a low-end config instance]. | |
| VERSION=2.7 | |
| sudo yum -y remove tmux | |
| sudo yum -y install wget tar libevent-devel ncurses-devel | |
| wget https://github.com/tmux/tmux/releases/download/${VERSION}/tmux-${VERSION}.tar.gz | |
| tar xzf tmux-${VERSION}.tar.gz | |
| rm -f tmux-${VERSION}.tar.gz | |
| cd tmux-${VERSION} |
I hereby claim:
To claim this, I am signing this object:
| ##----GIT------ | |
| alias gs='clear ;and git status' | |
| alias gb='git branch' | |
| alias gbranch='git rev-parse --abbrev-ref HEAD' #get current branch name | |
| alias gl="clear ;and git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" | |
| alias gt='git tag' | |
| alias grm='git rm' | |
| alias gps='git push' | |
| alias gbi='git bisect' | |
| alias gbg='git bisect good' |
| (function(root, factory) { | |
| if (typeof define === 'function' && define.amd) { | |
| define(['backbone.marionette', 'backbone.radio', 'underscore'], factory); | |
| } else if (typeof exports !== 'undefined') { | |
| module.exports = factory(require('backbone.marionette'), require('backbone.radio'), require('underscore')); | |
| } else { | |
| factory(root.Backbone.Marionette, root.Backbone.Radio, root._); | |
| } | |
| }(this, function(Marionette, Radio, _) { | |
| 'use strict'; |
| numbers = %w(zero one two three four five six seven eight nine) | |
| operations = { | |
| 'minus' => '-', | |
| 'plus' => '+', | |
| 'times' => '*', | |
| 'divided_by' => '/' | |
| } | |
| (0..9).each do |number| |
| class API::V1::BaseController < ApplicationController | |
| skip_before_filter :verify_authenticity_token | |
| before_filter :cors_preflight_check | |
| after_filter :cors_set_access_control_headers | |
| def cors_set_access_control_headers | |
| headers['Access-Control-Allow-Origin'] = '*' | |
| headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS' |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Magic words:
psql -U postgresSome interesting flags (to see all, use -h or --help depending on your psql version):
-E: will describe the underlaying queries of the \ commands (cool for learning!)-l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)