This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box_check_update = false | |
config.vm.provider "virtualbox" do |vb| | |
config.vm.box = "ubuntu/trusty64" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ex | |
echo '>>>> Installing Docker' | |
DEBIAN_FRONTEND=noninteractive apt-get install -qq lxc btrfs-tools libcgmanager0 | |
service lxc stop | |
sed -i 's|10\.0\.3|10.0.4|g' /etc/default/lxc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deployment: | |
push_to_linode: | |
branch: master | |
commands: | |
- git checkout master | |
- rsync -avz app [email protected]:/var/www | |
- rsync -avz migrations [email protected]:/var/www | |
- rsync -avz *.{py,txt} [email protected]:/var/www |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN; | |
DO $$ | |
BEGIN | |
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'task_status') THEN | |
create type task_status AS ENUM ('todo', 'doing', 'blocked', 'done'); | |
END IF; | |
END | |
$$; | |
CREATE TABLE IF NOT EXISTS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Overrides SSL verification for SmartConnect. | |
Usage: | |
from overide_ssl import get_context | |
# Append sslContext to your SmartConnect object init: | |
service_instance = connect.SmartConnect(host=args.host, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE person ( | |
id int primary key, | |
name varchar(200), | |
age int | |
) | |
CREATE TABLE personAddress ( | |
id int primary key | |
-- Below is the foreign key that links this table to the person table via the primary key (id) | |
person_id int references person(id), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Levs-MacBook-Pro-2:~ levlaz$ gem install rails -v 4.2.3 | |
Fetching: rack-1.6.4.gem (100%) | |
Successfully installed rack-1.6.4 | |
Fetching: rack-test-0.6.3.gem (100%) | |
Successfully installed rack-test-0.6.3 | |
Building native extensions. This could take a while... | |
ERROR: Error installing rails: | |
ERROR: Failed to build gem native extension. | |
current directory: /Users/levlaz/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.8/ext/nokogiri |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
utc_now = datetime.datetime.utcnow() | |
local_now = datetime.datetime.now() | |
print("The Local Time is {0}".format(local_now)) | |
print("The UTC Time is {0}".format(utc_now)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test(): | |
test_variable = 10 | |
return test_variable | |
def test2(test_variable): | |
if test_variable == 10: | |
print(test_variable) | |
a = test() | |
test2(a) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Test(): | |
def test(self): | |
self.test_variable = 10 | |
def test2(self): | |
if self.test_variable == 10: | |
print(self.test_variable) | |
a = Test() |