Skip to content

Instantly share code, notes, and snippets.

View cyruslk's full-sized avatar

cyruslk cyruslk

View GitHub Profile
@aconanlai
aconanlai / node-nfs.txt
Created June 27, 2019 01:31
node on nearlyfreespeech
Since mopsled didn't renew their domain, this is from their original blogpost which was a useful reference:
https://web.archive.org/web/20180220190550/http://www.mopsled.com/2015/run-nodejs-on-nearlyfreespeechnet/
NearlyFreeSpeech.net (NFSN) is a very inexpensive web host, DNS provider and domain registrar. NFSN added support in 2014 for NodeJS, Django, and tons of other languages through persistent processes. This guide, based on the Django tutorial provided by NFSN, will demonstrate the setup I used for creating a node.js daemon.
NFSN Configuration
If you’re creating a new website, select the Custom domain type:
Choose custom domain option for new site
@woudsma
woudsma / retrain-mobilenet-for-the-web.md
Last active November 1, 2022 05:09
Retrain a MobileNet model for the web with TensorFlow for Poets and TensorFlow.js

Retrain a MobileNet model and use it in the browser with TensorFlow.js

DRAFT

Combining TensorFlow for Poets and TensorFlow.js.
Retrain a MobileNet V1 or V2 model on your own dataset using the CPU only.
I'm using a MacBook Pro without Nvidia GPU.

MobileNets can be used for image classification. This guide shows the steps I took to retrain a MobileNet on a custom dataset, and how to convert and use the retrained model in the browser using TensorFlow.js. The total time to set up, retrain the model and use it in the browser can take less than 30 minutes (depending on the size of your dataset).

Example app - HTML/JS and a retrained MobileNet V1/V2 model.

@jthomas
jthomas / package.json
Last active September 24, 2023 21:58
Using TensorFlow.js with MobileNet models for image classification on Node.js
{
"name": "tf-js",
"version": "1.0.0",
"main": "script.js",
"license": "MIT",
"dependencies": {
"@tensorflow-models/mobilenet": "^0.2.2",
"@tensorflow/tfjs": "^0.12.3",
"@tensorflow/tfjs-node": "^0.1.9",
"jpeg-js": "^0.3.4"
@tmslnz
tmslnz / getTranslate3d.js
Created February 25, 2017 15:03
Get and array of translate3d values
function getTranslate3d (el) {
var values = el.style.transform.split(/\w+\(|\);?/);
if (!values[1] || !values[1].length) {
return [];
}
return values[1].split(/,\s?/g);
}
@hartzis
hartzis / EventComponent.js
Last active November 29, 2023 16:38
Touch Event Handling React Component
import React from 'react';
export default class EventComponent extends React.Component {
constructor(props) {
super(props);
this._onTouchStart = this._onTouchStart.bind(this);
this._onTouchMove = this._onTouchMove.bind(this);
this._onTouchEnd = this._onTouchEnd.bind(this);
@yamadayuki
yamadayuki / SampleComponent.js
Created June 19, 2016 14:58
Use keyframes property with React using inline style
import React from 'react';
import injectStyle from './path/to/injectStyle';
export default class SampleComponent extends React.Component {
constructor(props) {
super(props);
const keyframesStyle = `
@-webkit-keyframes pulse {
0% { background-color: #fecd6d; }
@elimisteve
elimisteve / alexa500-bad-python.txt
Created May 27, 2016 02:07
Alexa Top 500 sites that do NOT use SSL (as detected by a Python script I wrote)
qq.com
360.cn
blogspot.com
aliexpress.com
diply.com
gmw.cn
kat.cr
outbrain.com
go.com
360.com
@andrewlkho
andrewlkho / README.md
Last active March 30, 2023 01:22
Implementing HTTPS on NFSN (nearlyfreespeech.net) hosting using Let's Encrypt

These instructions are for implementing HTTPS on a NFSN-hosted static site using a certificate from Let's Encrypt. The certificate is generated manually on a separate computer.

Start off by installing the letsencrypt client. This requires sudo privileges and will install a bunch of packages:

% curl -O https://dl.eff.org/certbot-auto
% chmod +x ./certbot-auto
% ./certbot-auto

Generate the certificate. This will require you to publish some challenge responses on NFSN. I find it easiest to use tmux with letsencrypt running in one window and an SSH session to NFSN in another:

@cjonesy
cjonesy / macbook_pro_ubuntu_install.md
Last active April 26, 2024 09:28
Installing Ubuntu on MacBook Pro

Macbook Pro - Ubuntu Install

Requirements

2 USB drives > 2GB

Pre-Install

Create bootable USB drive

  1. Grab the latest Ubuntu Desktop iso image
@paulallies
paulallies / gist:0052fab554b14bbfa3ef
Last active November 12, 2023 23:00
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin <branch-name>