Skip to content

Instantly share code, notes, and snippets.

Constantine Nikolaou cnicolaou

Block or report user

Report or block cnicolaou

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cnicolaou
cnicolaou / .bash_profile
Last active May 30, 2018 — forked from hernamesbarbara/.bash_profile
bash_profile minimised to use on *NIX based machines, with terminal colors and useful aliases
View .bash_profile
#!/bin/bash
export TERM=xterm-color
export CLICOLOR=1
export GREP_OPTIONS='--color=auto'
# export LSCOLORS=Exfxcxdxbxegedabagacad
export LSCOLORS=gxfxcxdxbxegedabagacad # Dark lscolor scheme
# Don't put duplicate lines in your bash history
export HISTCONTROL=ignoredups
# increase history limit (100KB or 5K entries)
export HISTFILESIZE=100000
@cnicolaou
cnicolaou / url62.py
Created Feb 19, 2018 — forked from mattupstate/url62.py
python url62 implementation
View url62.py
import string
import uuid
alphabet = string.digits + string.ascii_letters
def base62_encode(n):
ret = ''
while n > 0:
ret = alphabet[n % 62] + ret
n /= 62
View Principles-of-Adult-Behavior.md

Principles of Adult Behavior

  1. Be patient. No matter what.
  2. Don’t badmouth: Assign responsibility, not blame. Say nothing of another you wouldn’t say to him.
  3. Never assume the motives of others are, to them, less noble than yours are to you.
  4. Expand your sense of the possible.
  5. Don’t trouble yourself with matters you truly cannot change.
  6. Expect no more of anyone than you can deliver yourself.
  7. Tolerate ambiguity.
  8. Laugh at yourself frequently.
@cnicolaou
cnicolaou / iterm2.md
Created Oct 5, 2017 — forked from squarism/iterm2.md
iterm2 cheatsheet
View iterm2.md

Tabs and Windows

Function Shortcut
Fullscreen + Enter
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number
Go to Window + Option + Number
Go to Split Pane by Direction + Option + Arrow
View keybase.md

Keybase proof

I hereby claim:

  • I am cnicolaou on github.
  • I am cnicolaou (https://keybase.io/cnicolaou) on keybase.
  • I have a public key ASBFP7NXhX9M-4u12JfBQUwN5peg3tR5O8uW1P_mWW5F5Qo

To claim this, I am signing this object:

@cnicolaou
cnicolaou / list_cheat_sheets.md
Last active May 9, 2016
Handy bookmark page to useful cheatsheets I use when coding
View list_cheat_sheets.md
@cnicolaou
cnicolaou / caesar_cipher.rb
Created Apr 15, 2016
Solution to Caesar Cipher implemented in ruby
View caesar_cipher.rb
def alphabet
Array('a'..'z') | (Array('A'..'Z'))
end
def cs_encrypt(string, key = 0)
# Rotate switches alphabets based on the passed key
dictionary = Hash[alphabet.zip(alphabet.rotate(key))]
string.chars.map { |str| dictionary.fetch(str, ' ') }
end
View upgrade_to_refinery_two.rb
class UpgradeToRefineryTwo < ActiveRecord::Migration
def self.up
# For refinerycms-authentication
rename_table :roles_users, :refinery_roles_users
rename_table :roles, :refinery_roles
rename_table :user_plugins, :refinery_user_plugins
rename_table :users, :refinery_users
remove_column :refinery_users, :persistence_token
remove_column :refinery_users, :perishable_token
remove_column :refinery_users, :remember_token
@cnicolaou
cnicolaou / setup-statsd.sh
Created Sep 9, 2012 — forked from collegeman/setup-statsd.sh
Turn an Ubuntu 10.04 linode into a StatsD/Graphite server
View setup-statsd.sh
# install git
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
# download the Node source, compile and install it
git clone https://github.com/joyent/node.git
cd node
./configure
make
sudo make install
# install the Node package manager for later use
View how-to-install-postgresql-on-an-ubuntu-1004-vagrant-box.markdown

Here's how to install PostgreSQL and have it run automatically at startup, on an Ubuntu 10.04 virtual machine using Vagrant. This took me a while to figure out:

Add the default lucid32 base box to your vagrant, if you haven't already:

host> vagrant box add lucid32 http://files.vagrantup.com/lucid32.box 

Now make a new lucid32 virtual machine and install postgresql on it:

You can’t perform that action at this time.