** The Best of the Best Practices (BOBP) Guide for Python https://gist.github.com/peautiful/starred ** python basic note http://blog.jobbole.com/48541/ ** python functional program
This file contains hidden or 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
<html> | |
<head> | |
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> | |
<script src="https://unpkg.com/axios/dist/axios.min.js"></script> | |
This file contains hidden or 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 json | |
import requests | |
import logging as log | |
log.basicConfig(level=log.DEBUG) | |
class FollowerExtractor(): | |
""" | |
Extracts followers for a given profile | |
""" |
This file contains hidden or 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> | |
<link rel="stylesheet" id="bs-css" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" > | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-progressbar/0.9.0/bootstrap-progressbar.js"> | |
</script> |
This file contains hidden or 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
// == used to compare string, number, object (including array) >> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators | |
// object should be same reference (in same memory) !!! | |
// Arrays are Objects in JavaScript which are pass by reference. This means that when I initialize an array: | |
var array = [1, 2, 3]; | |
// I've created a reference to that array in memory. If I then say: | |
var otherArray = [1 2, 3]; | |
// array and otherArray have two separate addresses in memory so they will not equal eachother (even though the values are equal.) To test out the pass by reference you can play around with arrays by doing: |
This file contains hidden or 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
from multiprocessing import Pool | |
import requests | |
from requests.exceptions import ConnectionError | |
def scrape(url): | |
try: | |
print requests.get(url) | |
except ConnectionError: | |
print 'Error Occured ', url |
This file contains hidden or 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> | |
<link rel="stylesheet" type="text/css" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css"> | |
<style> | |
#tasks{ | |
padding: 0px; | |
list-style-type:none} | |
</style> | |
<meta charset="utf-8"> |
This file contains hidden or 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
// a note on training freecodecamp.com | |
Remember that in order to start a comment, you need to use <!-- and to end a comment, you need to use --> | |
// simple | |
<h2 style="color:blue"> CatPhotoApp</h2> | |
// separate <style>, css to ELEMENT, auto call by html | |
<h2>CatPhotoApp</h2> | |
<p>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p> | |
<style> | |
h2 {color:blue;} |
This file contains hidden or 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
tldr | |
thefuck | |
verbalexpression |
This file contains hidden or 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
# install thefuck | |
sudo pip install thefuck | |
# edit alias in .bashrc or .bash_aliases in root | |
nano ~/.bashrc | |
TF_ALIAS=fuck alias fuck='eval $(thefuck $(fc -ln -1)); history -r' | |
source ~/.bashrc |