It is always recommened to use virtualenv while you are doing development. virtualenv lets you create isolated development environments. It will help you not to mixup dependencies when working on more than one project on your machine.
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 rot13(str) { | |
var arr = []; | |
for(var i = 0; i < str.length; i++){ | |
var code = 0; | |
code = str.charCodeAt(i); | |
if(code < 65){ | |
arr.push(String.fromCharCode(code)); | |
} else{ | |
code = code + 13; | |
if(code > 90){ |
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 destroyer(arr) { | |
// Remove all the values | |
var args = Array.from(arguments); | |
args = args.slice(1); | |
return arr.filter(function(val){ | |
return args.indexOf(val) == -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
const fs = require('fs'); | |
const zlib = require('zlib'); | |
const file = process.argv[2]; | |
fs.createReadStream(file) | |
.pipe(zlib.createGzip()) | |
.pipe(fs.createWriteStream(file + '.gz')); |
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
fs.createReadStream(file) | |
.pipe(crypto.createDecipher('aes192', 'a_secret')) | |
.pipe(zlib.createGunzip()) | |
.pipe(reportProgress) | |
.pipe(fs.createWriteStream(file.slice(0, -3))) | |
.on('finish', () => console.log('Done')); |
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
doctype html | |
html | |
head | |
title= title | |
link(rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css' | |
integrity='sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u' crossorigin='anonymous') | |
link(rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css') | |
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
doctype html | |
html | |
head | |
title= title | |
link(rel='stylesheet' href='https://yastatic.net/bootstrap/3.3.6/css/bootstrap.min.css') | |
link(rel='stylesheet', href='/stylesheets/style.css') | |
body | |
block content |
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
<div id="root"></div> | |
<script src="unpkg.com/react@16.0.0/umd/react.production.min.js"></script> | |
<script src="unpkg.com/react-dom@16.0.0/umd/react-dom.production.min.js | |
"></script> | |
<script type="text/javascript"> | |
// const rootElement = document.getElementById('root'); | |
// const element = document.createElement('div'); | |
// element.textContent = 'Hello World'; | |
// element.className = 'container'; |
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
$ sudo service postgresql start | |
$ pg_lsclusters | |
$ sudo pg_ctlcluster 9.6 main start | |
$sudo rabbitmqctl add_user myuser mypassword | |
$ sudo rabbitmqctl add_vhost myvhost | |
$ sudo rabbitmqctl set_user_tags myuser mytag | |
$ sudo rabbitmqctl set_permissions -p myvhost myuser ".*" ".*" ".*" |
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 reverse_it(arr): | |
if not arr: | |
return | |
high, low = len(arr) - 1 , 0 | |
while high > low: | |
arr[low], arr[high] = arr[high], arr[low] | |
high, low = high - 1, low + 1 | |
OlderNewer