Skip to content

Instantly share code, notes, and snippets.

View lcb931023's full-sized avatar
:octocat:
tentaculous

Changbai Li lcb931023

:octocat:
tentaculous
View GitHub Profile
@adammcfadden
adammcfadden / font-loader.vue
Last active June 26, 2021 10:18
Vue component for loading minimal fonts with webfontloader
// Vue component for loading minimal fonts with webfontloader
<template>
</template>
<script>
//https://github.com/typekit/webfontloader
import WebFontLoader from 'webfontloader';
export default {
@keijiro
keijiro / gpd_pocket.md
Last active December 18, 2019 02:04
My personal notes on GPD Pocket

pic

I backed the [GPD Pocket] project on Indiegogo immediately after its launch announcement. I had to wait for a few extra months from their estimated release date (it seems they had some technical issues with Linux driver development) then finally got a device last week. The production quality is still not perfect but significantly improved from the previous product (GPD Win) -- I can admit that I'm almost satisfied with it.

@tsbits
tsbits / [ThreeJS] Don't clear the canvas
Last active August 14, 2021 12:28
[ThreeJS] Don't clear the canvas
renderer = new THREE.WebGLRenderer({preserveDrawingBuffer: true});
renderer.autoClearColor = false;
@mattdesl
mattdesl / modular-three.md
Last active December 9, 2021 03:20
quick/easy ThreeJS hacking with npm

This isn't bullet-proof but here's how I've doing things lately:

modular ThreeJS quickie

  • npm install three --save
  • Include this in your browserify/webpack root script, typically your index.js:
global.THREE = require('three')
  • Add the "THREE" global to your linter (e.g. semistandard/eslintrc)
@mneil
mneil / kioskmode.bat
Created February 15, 2016 19:56
Kill chrome and open a new page in kiosk mode
taskkill /F /IM Chrome.exe /T
### Open a local index.html file in the same directory as this batch file
# start chrome --kiosk --profile-directory=Default --app="%~dp0/index.html"
### Open a website URL
start chrome --kiosk --profile-directory=Default --app="http://google.com"
@maximilian-lindsey
maximilian-lindsey / express_in_electron.md
Last active April 29, 2026 00:48
How to run Express inside an Electron app

How to run Express inside an Electron app

You can run your Express app very easily inside your Electron app.

All you need to do is to:

  • place all the files of your Express app inside a new app folder in your_electron_app\resources\app
  • reconfigure the app.js file
  • refactor some relative pathes in your Express app
@gabonator
gabonator / serialws.js
Created November 7, 2015 17:57
Serial port to websocket connector using NodeJs
// http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
"use strict";
process.title = 'node-serial-ws';
// Websocket
var webSocketsServerPort = 1337;
var webSocketServer = require('websocket').server;
var http = require('http');
var server = http.createServer(function(request, response) {
// Not important for us. We're writing WebSocket server, not HTTP server
@mikkoh
mikkoh / gist:f8c5148871bb3ba57455
Created June 4, 2015 14:28
Converting between TypedArrays
/**
* To convert between typed arrays an ArrayBuffer can be used to create
* TypedArray's from one type to another. Each typed array has a property
* which is an ArrayBuffer.
**/
var uint16 = new Uint16Array([0x0102, 0x0304]);
var uint32 = new Uint32Array(uint16.buffer);
var uint8clamped = new Uint8ClampedArray(uint16.buffer);
var uint8 = new Uint8Array(uint16.buffer);
@nateperry
nateperry / Sass Icon List
Created April 26, 2015 06:30
For a project with a lot of custom icons, I needed an easy to maintain solution for adding new icon classes. The parents part comds in to allow parent elements to be hovered and still show the hover icon.
// to add new icons, add the file to the media/icons folder
// then add the name of the file to the $icon-list
// each item will get a class name that matches the file name
$icon-list: add_widget alert appointments back blood_glucose blood_pressure chat collapse expand find_doctor fitness_planner food_journal github internet linkedin medical_history medication message nav_back nav_next overview patient_directory personal_profile recipe regimen_plan search settings sleep_analysis widget_directory
// all parent elements that need to trigger icon hover
$parents: '.btn' '.widget-button'
=all-icons
@each $icon in $icon-list
@kevinSuttle
kevinSuttle / app.js
Last active February 26, 2024 07:02
Gulp, BrowserSync, Sass, Autoprefixer, Nodemon
var express = require('express');
var app = express();
var router = express.Router();
var hbs = require('hbs');
app.set('view engine', 'html');
app.engine('html', hbs.__express);
app.use(express.json());
app.use(express.urlencoded());