Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
# Notes | |
# Using iCloud Drive, you can sync your Sublime Text 3 | |
# plugins and prefs so you can always have the same setup | |
# Prerequisites | |
# Make sure both machines have the latest version of OSX 10.10.x with | |
# Yosemite or higher and iCloud Drive turned on | |
# Quit ST3 |
#!/bin/bash | |
# This script lets you play music from you terminal. | |
# 1) Install mplayer | |
# 2) chmod +x music | |
# 3) Put 'music' script in a folder on your PATH. | |
# 4) Enjoy ;) | |
if [ -z $1 ]; then | |
echo "Usage:" |
Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts) on a web page to be requested from another domain outside the domain from which the first resource was served. This is set on the server-side and there is nothing you can do from the client-side to change that setting, that is up to the server/API. There are some ways to get around it tho.
Sources : MDN - HTTP Access Control | Wiki - CORS
CORS is set server-side by supplying each request with additional headers which allow requests to be requested outside of the own domain, for example to your localhost
. This is primarily set by the header:
Access-Control-Allow-Origin
Service | SSL | status | Response Type | Allowed methods | Allowed headers |
---|
import q from 'q' | |
import passport from 'passport' | |
import { Strategy } from 'passport-github' | |
import Github from 'github' | |
passport.use( | |
new Strategy({ clientID: CLIENT_ID, clientSecret: CLIENT_SECRET }, | |
async (req, accessToken, refreshToken, profile, done) => { | |
const github = new Github({ version: '3.0.0' }) | |
github.authenticate({ type: 'token', token: accessToken }) |
// time and time end | |
console.time("This"); | |
let total = 0; | |
for (let j = 0; j < 10000; j++) { | |
total += j | |
} | |
console.log("Result", total); | |
console.timeEnd("This"); | |
// Memory |