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
# 0 - Loop over a range of numbers | |
# Use range instead of xrange | |
# Range in python 3 creates an iterator which produces the values one at a time (it's much more efficient and fast) | |
nums = [0,2, 34, 55, 32] | |
for i in range(nums): | |
print i | |
# 1 - Looping backwards | |
# Use reversed |
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
// Based on: http://stackoverflow.com/questions/14368596/how-can-i-check-that-two-objects-have-the-same-set-of-property-names | |
Object.prototype.isIdenticalTo = function(targetObject) { | |
// check that targetObject is an object | |
// if no argument is passed and it's not an object | |
// throw an error | |
if (!targetObject || typeof(targetObject) !== "object") { | |
throw new Error("Argument of type Object must be passed") | |
} |
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
# Main client class | |
# Makes the credentials available to the other classes | |
# In this scenario, User uses or has an API, but it isn't an API | |
# So we don't really need to inherit from the client class (Dribbble_API) | |
class Dribbble_API(object): | |
def __init__(self, client_id=None, client_secret=None, access_token=None): | |
self.client_id = client_id |
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 argparse | |
import requests | |
import webbrowser | |
ROOT_URL = "https://api.foursquare.com/v2/venues/" | |
parser = argparse.ArgumentParser(description="Wrapper around the foursquare API. Use it to retrieve information about\ | |
specific venues or groups of venues.") | |
parser.add_argument("endpoint", help="Name of the resource you want to access", choices=["categories", "trending",\ | |
"explore", "search"]) |
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
(function(){ | |
window.Player = function(config = {}){ | |
this.defaults = { | |
name: "Karim Benzema", | |
age: 29, | |
position: "CF", | |
club: "Real Madrid CF" | |
} |
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
# This script will attempt to fetch data from Yahoo finance for a particular | |
# stock, get the prices for the last 6 months and save the info to a csv file | |
import requests | |
from bs4 import BeautifulSoup | |
import csv | |
import time | |
def get_prices(url): | |
print("Fetching Prices ...") |
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
// ---- | |
// libsass (v3.2.5) | |
// ---- | |
.guide-block__item { | |
flex: 0 1 100%; | |
height: auto; | |
$count: 1; |
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
// **** ANIMATION **** // | |
// zerosixthree | |
=animation($str) | |
-webkit-animation: #{$str} | |
-moz-animation: #{$str} | |
-ms-animation: #{$str} | |
-o-animation: #{$str} | |
animation: #{$str} |
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
// Pomodoro Module | |
var PomodoroApp = (function() { | |
var pomodoro = { | |
countDown: false, | |
minutesLeft: false, | |
secondsLeft: false, | |
endFunction: false | |
}; |
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
<script> | |
// Create a counter to check how many times the function was called | |
var numberSessionsDone = 0; | |
var initialTime = 25; | |
var output = document.getElementById('output'); | |
// this is the countDown timer | |
function runSession(timeInMinutes, endFunction) { |