View demo-middleware-1.js
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 restaurantOwnerOnlyMiddleware = (req, res, next) => { | |
const {restaurantId} = req.params; // in this case, the id is part of the path | |
const user = req.user; // available if you're using Google Firebase Authentication Middleware | |
const hasPermission = (id, user) => true; // do your checks here instead | |
if (!hasPermission(restaurantId, user)) { | |
res.status(403).send("Unauthorized"); | |
return; | |
} |
View map, filter and reduce explained
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
map(['🐮','🍠', '🐔', '🌽'], cook); | |
=> ['🍔', '🍟', '🍗', '🍿']; | |
filter(['🍔', '🍟', '🍗', '🍿'], isVegetarian); | |
=> ['🍟', '🍿']; | |
reduce(['🍔', '🍟', '🍗', '🍿'], eat); | |
=> ['💩']; |
View index.html
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>海德沙龙刷机包</title> | |
<style> | |
.node circle { | |
fill: #fff; | |
stroke: steelblue; | |
stroke-width: 3px; | |
} |
View hello.md
View biggan-search.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View umap_sparse.py
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
### JHW 2018 | |
import numpy as np | |
import umap | |
# This code from the excellent module at: | |
# https://stackoverflow.com/questions/4643647/fast-prime-factorization-module | |
import random |
View convert_daily_to_monthly.py
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
################################################################################################ | |
# name: convert_daily_to_monthly.py | |
# desc: takes inout as daily prices and convert into monthly data | |
# date: 2018-06-15 | |
# Author: conquistadorjd | |
################################################################################################ | |
import pandas as pd | |
import numpy as np | |
print('*** Program Started ***') |
View pwd.js
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
{passwords:"123456,password,12345678,qwerty,123456789,12345,1234,111111,1234567,dragon,123123,baseball,abc123,football,monkey,letmein,shadow,master,696969,mustang,666666,qwertyuiop,123321,1234567890,pussy,superman,654321,1qaz2wsx,7777777,fuckyou,qazwsx,jordan,123qwe,000000,killer,trustno1,hunter,harley,zxcvbnm,asdfgh,buster,batman,soccer,tigger,charlie,sunshine,iloveyou,fuckme,ranger,hockey,computer,starwars,asshole,pepper,klaster,112233,zxcvbn,freedom,princess,maggie,pass,ginger,11111111,131313,fuck,love,cheese,159753,summer,chelsea,dallas,biteme,matrix,yankees,6969,corvette,austin,access,thunder,merlin,secret,diamond,hello,hammer,fucker,1234qwer,silver,gfhjkm,internet,samantha,golfer,scooter,test,orange,cookie,q1w2e3r4t5,maverick,sparky,phoenix,mickey,bigdog,snoopy,guitar,whatever,chicken,camaro,mercedes,peanut,ferrari,falcon,cowboy,welcome,sexy,samsung,steelers,smokey,dakota,arsenal,boomer,eagles,tigers,marina,nascar,booboo,gateway,yellow,porsche,monster,spider,diablo,hannah,bulldog,junior,london,purple,co |
View separate_points.py
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
def lat_lon_hex_mesh(bounds, d=3): | |
"""Creates a hexagonal lat/lon mesh within bounds that has a radial separation of d""" | |
lone, lonw, lats, latn = bounds | |
# heigt of equilatral triangle from radial distance sqrt(r^2 - (r/2)^2) | |
h = np.sqrt(0.75) * d | |
w = d / 2 | |
lat_vals = np.arange(lats, latn, h) |
View line_girl.rb
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
W = 500 | |
H = 585 | |
W1 = W - 1 | |
H1 = H - 1 | |
def setup | |
@img = load_image '../scratch/girl.png' | |
@img.filter BLUR, 3 | |
@img.load_pixels | |
end |
NewerOlder