Skip to content

Instantly share code, notes, and snippets.

View lianyi's full-sized avatar

lianyi lianyi

  • Bethesda MD
View GitHub Profile
@wh1tney
wh1tney / deploy-static-site-heroku.md
Last active May 8, 2024 18:14
How to deploy a static website to Heroku

Gist

This is a quick tutorial explaining how to get a static website hosted on Heroku.

Why do this?

Heroku hosts apps on the internet, not static websites. To get it to run your static portfolio, personal blog, etc., you need to trick Heroku into thinking your website is a PHP app. This 6-step tutorial will teach you how.

Basic Assumptions

@khanhnamle1994
khanhnamle1994 / main.py
Last active January 26, 2024 22:14
FCN - Full Code
#--------------------------
# USER-SPECIFIED DATA
#--------------------------
# Tune these parameters
num_classes = 2
image_shape = (160, 576)
EPOCHS = 40
BATCH_SIZE = 16
@pom-pom
pom-pom / font-awesome-form-elements.css
Last active January 8, 2024 01:52
Font Awesome Radio Buttons and Checkboxes
/*Custom Radio Buttons and Checkboxes using Font Awesome*/
input[type=radio],
input[type='checkbox'] {
display: none;
}
input[type=radio] + label {
display: block;
}
input[type='checkbox'] + label:before,
@baraldilorenzo
baraldilorenzo / readme.md
Last active November 21, 2023 22:41
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman

@fchollet
fchollet / classifier_from_little_data_script_3.py
Last active September 13, 2023 03:34
Fine-tuning a Keras model. Updated to the Keras 2.0 API.
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
@PizzaBrandon
PizzaBrandon / jquery.waituntilexists.js
Last active August 24, 2023 14:23 — forked from buu700/jquery.waituntilexists.js
Updated waitUntilExists plugin
;(function ($, window) {
var intervals = {};
var removeListener = function(selector) {
if (intervals[selector]) {
window.clearInterval(intervals[selector]);
intervals[selector] = null;
}
@RandomEtc
RandomEtc / mongo_import.js
Created September 15, 2011 16:04
use node.js to copy from one mongo db to another
var url = require('url'),
mongodb = require('mongodb');
var sourceUrl = 'mongodb://user:pass@host:port/db',
targetUrl = 'mongodb://user:pass@host:port/db',
collectionName = 'my_awesome_collection';
function openDbFromUrl(mongoUrl, cb) {
var dbUrl = url.parse(mongoUrl),
dbName = dbUrl.pathname.slice(1), // no slash
@pjsvis
pjsvis / gist:6210002
Last active November 13, 2020 00:56
Angular directive for jQuery sparkline
// Requires jQuery from http://jquery.com/
// and jQuerySparklines from http://omnipotent.net/jquery.sparkline
// AngularJS directives for jquery sparkline
angular.module('sparkline', []);
angular.module('sparkline')
.directive('jqSparkline', [function () {
'use strict';
return {
@lianyi
lianyi / vtk2vtp.py
Created March 4, 2019 17:14 — forked from thomasballinger/vtk2vtp.py
vtk2vtp.py
#!/usr/bin/env python
"""File format conversion
category: vtk, file conversion, tomb"""
import os, sys
import vtk
def vtk2vtp(invtkfile, outvtpfile, binary=False):
"""What it says on the label"""
reader = vtk.vtkPolyDataReader()
@lianyi
lianyi / analog.py
Created February 28, 2019 01:40
The following code can be downloaded directly to your Raspberry Pi. It will read the trimpot value, translate the reading to a volume range and modify the OS output volume level on your Raspberry Pi. The remap_range() method is being used to convert the 16-bit analog in range 0 - 65,535 to volume 0-100%.
import os
import time
import busio
import digitalio
import board
import adafruit_mcp3xxx.mcp3008 as MCP
from adafruit_mcp3xxx.analog_in import AnalogIn
# create the spi bus
spi = busio.SPI(clock=board.SCK, MISO=board.MISO, MOSI=board.MOSI)