Skip to content

Instantly share code, notes, and snippets.

View thewillhuang's full-sized avatar

William Huang thewillhuang

View GitHub Profile
@nberardi
nberardi / on-model-3-charging.json
Created March 6, 2023 15:08
Node Red - On Model 3 Charging Adjust Amperage From Car To Maximize Sun Without Grid Usage
[
{
"id": "d20b09cd596147aa",
"type": "tab",
"label": "On Model 3 charging",
"disabled": false,
"info": "",
"env": []
},
{
@ih2502mk
ih2502mk / list.md
Last active October 27, 2025 01:50
Quantopian Lectures Saved
@coco98
coco98 / elgordino-hasura.tf
Created December 19, 2018 08:31
Terraform spec for Hasura on Fargate and RDS
provider "aws" {
region = "${var.region}"
}
### VPC
# Fetch AZs in the current region
data "aws_availability_zones" "available" {}
resource "aws_vpc" "datastore" {
cidr_block = "172.17.0.0/16"
@mrienstra
mrienstra / unregisterServiceWorkers.js
Created February 4, 2018 22:10
Unregister service workers, verbose
navigator.serviceWorker.getRegistrations().then(function (registrations) {
if (!registrations.length) {
console.log('No serviceWorker registrations found.')
return
}
for(let registration of registrations) {
registration.unregister().then(function (boolean) {
console.log(
(boolean ? 'Successfully unregistered' : 'Failed to unregister'), 'ServiceWorkerRegistration\n' +
(registration.installing ? ' .installing.scriptURL = ' + registration.installing.scriptURL + '\n' : '') +
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod
@Dagnan
Dagnan / application.html.erb
Last active November 21, 2020 19:10 — forked from averyvery/application.rb
Inline CSS or JS in Rails 5
<!DOCTYPE html>
<html>
<head>
<%= inline_js 'application.js' %>
<%= inline_css 'application.css' %>
</head>
<body>
</body>
</html>
import React, { Component, PropTypes } from 'react'
import {
Text,
View,
TouchableHighlight,
ScrollView,
StatusBar,
Dimensions,
Animated
@tzmartin
tzmartin / embedded-file-viewer.md
Last active October 23, 2025 12:08
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@keeth
keeth / api.tf
Last active January 13, 2021 14:34
Apex + Terraform + AWS Lambda + API Gateway + JSON Encoded Errors + CORS
resource "aws_api_gateway_rest_api" "myApi" {
name = "myApi-${var.env}"
description = "My awesome API (${var.env} environment)"
}
resource "aws_api_gateway_deployment" "myApi" {
depends_on = [
"aws_api_gateway_integration.myApi_myEndpoint_post",
"aws_api_gateway_integration_response.myApi_myEndpoint_post",
"aws_api_gateway_integration_response.myApi_myEndpoint_post_400",
@oxpa
oxpa / webpack.config.js
Last active January 14, 2020 16:26
webpack configuration suitable for static content generator plugin and chunks
var path = require('path');
var StaticSiteGeneratorPlugin = require('static-site-generator-webpack-plugin')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var webpack = require('webpack');
var urlloader = require('url-loader');
var React = require("react");
var ReactDom = require("react-dom");
var Redux = require("redux");