Skip to content

Instantly share code, notes, and snippets.

@machinefriendly
machinefriendly / python.md
Last active November 7, 2015 11:20
python learning source note
@machinefriendly
machinefriendly / thefuck_cloud9
Last active September 6, 2019 07:34
install and set alias of thefuck on cloud9
# 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
tldr
thefuck
verbalexpression
// 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;}
@machinefriendly
machinefriendly / index.html
Last active February 17, 2016 08:44 — forked from anonymous/index.html
JS Bin// source http://jsbin.com/wiwufopira // todo list css html
<!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">
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
// == 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:
@machinefriendly
machinefriendly / index.html
Created December 6, 2016 13:58 — forked from anonymous/index.html
// source http://jsbin.com/gujurij bootstrap progressbar.js
<!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>
@machinefriendly
machinefriendly / instagram_followers.py
Last active April 30, 2018 14:43 — forked from tomkdickinson/instagram_followers.py
Followers Extraction Instagram
import json
import requests
import logging as log
log.basicConfig(level=log.DEBUG)
class FollowerExtractor():
"""
Extracts followers for a given profile
"""
<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>