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
#send files through ssh | |
scp /path/to/my.file me@serverB:/path/to/destination/my.file |
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
#Mongo Console | |
#see all available db's | |
show dbs | |
#change current db to database "db_name" | |
use db_name | |
#see all collections in current db | |
db.getCollectionNames() | |
#see content of "collection_name" | |
db.collection_name.find() |
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
function bfs(graph, start){ | |
var queue = []; | |
var visited = new Set(); | |
var current_node; | |
queue.push(start); | |
visited.add(start); | |
while(queue.length > 0){ | |
current_node = queue.shift(); | |
var child; | |
for (var i = 0; i < current_node["adjacency_list"].length; i++) { |
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
var Set = function() {}; | |
Set.prototype.add = function(o) { this[o] = true; } | |
Set.prototype.remove = function(o) { delete this[o]; } | |
Set.prototype.has = function(o) {return (o in this)} |
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
cd repository | |
git checkout --orphan gh-pages | |
# Creates our branch, without any parents (it's an orphan!) | |
# Switched to a new branch 'gh-pages' | |
git rm -rf . # Remove all files from the old working tree # rm '.gitignore' | |
echo "My GitHub Page" > index.html | |
git add index.html | |
git commit -a -m "First pages commit" | |
git push origin gh-pages |
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
angular.module('mean').directive('ngEnter', function() { | |
return function(scope, element, attrs) { | |
element.bind("keydown keypress", function(event) { | |
if(event.which === 13) { | |
scope.$apply(function(){ | |
scope.$eval(attrs.ngEnter); | |
}); | |
event.preventDefault(); | |
} |
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
# Ubuntu 12.04 | |
# Goal: Setting up Production Environment for Ruby On Rails | |
# First Step: Create new user | |
# sudo useradd nameOfNewUser | |
# sudo passwd PASSWORD | |
# sudo adduser nameOfNewUser sudo | |
# su nameOfNewUser | |
# chsh (/bin/bash) | |
# sudo chown nameOfNewUser /home/nameOfNewUser |
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 math | |
def recurrent(n): | |
global counter | |
counter+=1 | |
if(counter%10000 == 0): | |
print(counter) | |
if n == 1: | |
return 0 | |
elif n < 1: |
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
# Chile | |
# From Paul Eggert (2015-04-03): | |
# Shanks & Pottenger says America/Santiago introduced standard time in | |
# 1890 and rounds its UTC offset to 70W40; guess that in practice this | |
# was the same offset as in 1916-1919. It also says Pacific/Easter | |
# standardized on 109W22 in 1890; assume this didn't change the clocks. | |
# | |
# Dates for America/Santiago from 1910 to 2004 are primarily from | |
# the following source, cited by Oscar van Vlijmen (2006-10-08): |
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
## | |
# The IncludedResourceParams class is responsible for parsing a string containing | |
# a comma separated list of associated resources to include with a request. See | |
# http://jsonapi.org/format/#fetching-includes for additional details although | |
# this is not required knowledge for the task at hand. | |
# | |
# Our API requires specific inclusion of related resourses - that is we do NOT | |
# want to support wildcard inclusion (e.g. `foo.*`) | |
# | |
# The IncludedResourceParams class has three public methods making up its API. |
OlderNewer