Cowboy is such a simple web framework.
This is a sample websocket app.
Use erlang.mk. Not that you have to, but it'd make things a bit easier.
First, create a folder for project, ex. myproject.
$ cd myproject/
git clone git://gist.github.com/3944262.git seven_langs_ruby | |
cd seven_langs_ruby | |
gem install gli -v 1.6.0 | |
gem install showoff | |
showoff serve | |
open "http://localhost:9090" |
#!/bin/bash | |
set -eo pipefail | |
aws route53 list-hosted-zones --query 'HostedZones[].Id' | \ | |
jq -r '.[]' | sed 's/\/hostedzone\///' \ | |
| \ | |
xargs -I zone_id \ | |
aws route53 list-resource-record-sets \ | |
--hosted-zone-id zone_id \ |
#!/usr/bin/env python3 | |
import os | |
import sys | |
from base64 import b64encode | |
from uuid import uuid4 | |
try: | |
from cryptography import x509 | |
from cryptography.hazmat.backends import default_backend |
The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.
The correct way of creating a private frok by duplicating the repo is documented here.
For this assignment the commands are:
git clone --bare git@github.com:usi-systems/easytrace.git
// https://www.youtube.com/watch?v=wU6udHRIkcc | |
/* | |
Disjoint Set Union (“DSU”) is the Data Structure: disjoint-set data structure | |
is a data structure that keeps track of a set of elements partitioned into a | |
number of disjoint (non-overlapping) subsets. | |
Union Find is the Algorithm: A union-find algorithm is an algorithm that can | |
be used to detect cycles in an undirected graph & performs two useful operations | |
on such a data structure: |
#Model | |
@user.should have(1).error_on(:username) # Checks whether there is an error in username | |
@user.errors[:username].should include("can't be blank") # check for the error message | |
#Rendering | |
response.should render_template(:index) | |
#Redirecting | |
response.should redirect_to(movies_path) |
use std::str; | |
fn main() { | |
// -- FROM: vec of chars -- | |
let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}']; | |
// to String | |
let string1: String = src1.iter().collect::<String>(); | |
// to str | |
let str1: &str = &src1.iter().collect::<String>(); | |
// to vec of byte |
//Authorization popup window code | |
function ShowAuthWindow(options) | |
{ | |
console.log('ee'); | |
options.windowName = options.windowName || 'ConnectWithOAuth'; // should not include space for IE | |
options.windowOptions = options.windowOptions || 'location=0,status=0,width=800,height=400'; | |
options.callback = options.callback || function(){ window.location.reload(); }; | |
var that = this; | |
console.log(options.path); | |
that._oauthWindow = window.open(options.path, options.windowName, options.windowOptions); |
Command Line
pry -r ./config/app_init_file.rb
- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb
- load your rails into a pry sessionDebugger