Skip to content

Instantly share code, notes, and snippets.

View stanleyyylau's full-sized avatar

Stanley stanleyyylau

View GitHub Profile
<input type="file" onchange="predict(this.files[0])">
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js"></script>
<script>
const MODEL_PATH = '/web_model/model.json';
function file2img(f) {
return new Promise(resolve => {
const reader = new FileReader();
reader.readAsDataURL(f);
@stanleyyylau
stanleyyylau / kinsta_users.php
Created September 12, 2018 04:51 — forked from carlodaniele/kinsta_users.php
A plugin for registering a custom post type with a specific set of capabilities
<?php
/**
* @package Kinsta_users
* @version 1.0
*/
/*
Plugin Name: Kinsta users
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Carlo Daniele
```
2018-09-10T02:29:16Z: identifier="routes:build-info" level="WARN" message="Build Info file not found, and hence not set up to inform actual version of the app."
Warning: React depends on requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills
path.js:28
throw new TypeError('Path must be a string. Received ' + inspect(path));
^
TypeError: Path must be a string. Received undefined
at assertPath (path.js:28:11)
@stanleyyylau
stanleyyylau / contact-form-7-includes-mail.php
Last active February 25, 2019 10:32
Start from line 371, We use the http://ip-api.com/ Service to append location info to IP address before sending out contact form7 mail
<?php
class WPCF7_Mail {
private static $current = null;
private $name = '';
private $template = array();
private $use_html = false;
private $exclude_blank = false;
@stanleyyylau
stanleyyylau / gist:e857ca16693e63b125f8db739df92014
Created January 8, 2017 06:01 — forked from learncodeacademy/gist:5f84705f2229f14d758d
Getting Started with Vagrant, SSH & Linux Server Administration
@stanleyyylau
stanleyyylau / funky_underscore.js
Created July 17, 2016 11:43 — forked from carloshanson/funky_underscore.js
Test to understand basics of underscore.js
// test to understand basics of underscore.js
(function(){
// reference global object as root
var root = this;
// create function object named funky instead of _
var funky = function() { };
// attach function object to global object
@stanleyyylau
stanleyyylau / gist:e9a46d286d1ec032f0b38aed5385fd13
Created June 1, 2016 05:38 — forked from learncodeacademy/gist:5850f394342a5bfdbfa4
SSH Basics - Getting started with Linux Server Administration

###SSH into a remote machine###

ssh [email protected]
#or by ip address
ssh [email protected]

exit: exit ###Install Something###

#If it's a new server, update apt-get first thing