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
ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg']) | |
APP_ROOT = os.path.dirname(os.path.abspath(__file__)) | |
UPLOAD_FOLDER = os.path.join(APP_ROOT, 'static/uploads') | |
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER | |
# example taken from http://flask.pocoo.org/docs/0.10/patterns/fileuploads/ | |
def allowed_file(filename): | |
return '.' in filename and \ |
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
req = http://www.ratemyprofessors.com/api/professors/1047122/ratings // comprehensive | |
req = http://www.ratemyprofessors.com/api/professors/925226/ratings?page=1 // comprehensive | |
req = http://www.ratemyprofessors.com/api/professors/925226/ratingsbyclass //list of ratings sorted by class | |
req = http://www.ratemyprofessors.com/api/professors/925226 // overall meta | |
results = { | |
"id": 1047122, | |
"fName": "Jennifer", | |
"lName": "Wong-Ma", | |
"middleInitials": "", | |
"fullName": "Jennifer Wong-Ma", |
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
request = http://search.mtvnservices.com/typeahead/suggest/?solrformat=true&q=s&rows=500&defType=edismax&bq=schoolname_sort_s%3A%22s%22%5E1000&qf=schoolname_autosuggest&bf=pow%28total_number_of_ratings_i%2C1.9%29&sort=score%2Bdesc&siteName=rmp&rows=500&group=off&group.field=content_type_s&group.limit=500&fq=content_type_s%3ASCHOOL | |
response = { | |
"responseHeader": { | |
"status": 0, | |
"QTime": 2 | |
}, | |
"response": { | |
"numFound": 2268, | |
"start": 0, | |
"docs": [{ |
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 HOST = 'https://###.firebaseio.com/items.json' | |
var fs = require('fs') | |
var datapath = __dirname + '/videos' | |
var exec = require("child_process").execSync | |
var request = require('request') | |
request(HOST, function (err, res, body) { | |
if (res.statusCode == 200) { | |
var result = JSON.parse(body); | |
for (var key in result) { |
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
on run {input, parameters} | |
tell application "Terminal" | |
close (every window whose name contains "PokemonGo-bot") | |
end tell | |
tell application "System Events" to tell process "Terminal" | |
if exists (sheet 1 of window 1) then | |
tell application "System Events" to click UI element "Terminate" of sheet 1 of window 1 of application process "Terminal" | |
end if | |
end tell | |
tell application "Terminal" |
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
//test |
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
//get quotes fro https://worldhistoryproject.org/topics/mahatma-gandhi | |
var items = document.getElementsByClassName("media-list")[0].children; | |
for (var item in items) { | |
var time = item.children[0].textContent; | |
var mediaHeading = item.children[1].children[1].children[0].innerText; | |
var link = item.children[1].children[1].children[0].getAttribute("href"); | |
const output = `<li> | |
<a href="https://worldhistoryproject.org${link}"> | |
<b>${time.trim()}</b> - ${mediaHeading}. |
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
{"lastUpload":"2019-11-30T22:53:19.044Z","extensionVersion":"v3.4.3"} |
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 MIDDLE_OF_THE_SCREEN_OFFSET = SCREEN_HEIGHT/2 - 120; | |
//initially | |
this.modalAnimation = new Animated.ValueXY({ | |
x: 0, | |
y: MIDDLE_OF_THE_SCREEN_OFFSET | |
}); | |
//responser | |
onPanResponderRelease: (e, gestureState) => { |
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 Template() { | |
const camelize = str => | |
str.replace(/\W+(.)/g, (_match, chr) => chr.toUpperCase()); | |
return { | |
userInputs: [ | |
{ | |
title: 'Enter the component name', | |
argumentName: 'name', | |
defaultValue: 'HomeComponent' | |
} |