Skip to content

Instantly share code, notes, and snippets.

{
"name": "NodejsStarterApp",
"version": "0.0.1",
"description": "A sample nodejs app for Bluemix",
"scripts": {
"start": "node app.js"
},
"dependencies": {
"express": "4.12.x",
"cfenv": "1.0.x"
<!DOCTYPE html>
<html>
<head>
<title>NodeJS Starter Application</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="stylesheets/style.css">
</head>
import sys
try:
from lxml import etree
#print("running with lxml.etree")
except ImportError:
try:
# Python 2.5
import xml.etree.cElementTree as etree
:%s/^\( *\)\(.* \)\(\w\+\)\( *=.\{-\}createElement("<\w\+\) \(\w\+\)=\\"\(.\{-\}\)\\"\(.*\)\n/\1\2\3\4\7\r \3.setAtrribute("\5", "\6");\r
{
"name" : "node-red-bluemix-starter",
"version" : "0.6.0",
"dependencies": {
"appmetrics-dash": "^3.2.1",
"when": "~3.x",
"nano": "6.2.x",
"bcrypt": "1.0.2",
"cfenv":"~1.0.0",
"express":"4.x",
@jgkong
jgkong / tutorial1.md
Last active November 27, 2017 08:51
IBM Developer Connect 2017 - ESP8266 Hands-on material

준비사항

  • 랩탑
  • Micro USB 케이블
  • Chrome, Firefox, Edge 등 modern browser (IE 는 안됩니다..)
  • Wifi - esp8266 / ibmcloud

NodeMCU setup

  • http://micropython.org/webrepl/ Micropython webrepl 접속
  • MicroPython-XXXXXX 접속, WPA2 key 는 micropythoN
  • Password 에 스티커의 4~5 비밀번호 입력
@jgkong
jgkong / gist:3c5ec5dd3b16a847cf1031e046867584
Created August 30, 2018 15:26
Timelapse postprocessing scripts
# Make 60fps timelapse mp4 from jpgs
ffmpeg -framerate 60 -pattern_type glob -i "*.jpg" -s 1280x720 -pix_fmt yuv420p -r 60 -q:v 2 ../timelapse.mp4
# Partial blur of jpgs
for f in 2018-*; do echo $f; convert $f -crop 325x270+690+370 -scale 10% -scale 1000% screen.jpg; convert -page +0+0 $f -page +690+370 screen.jpg -layers flatten ../$f; done
# Partial time/area blur of video
#
# length of input video: 104s
# timeslot to partial blur: 60-95s
EXTERNAL_IP=$(kubectl get nodes -o jsonpath='{..addresses[?(@.type=="ExternalIP")].address}')
mysql -h $EXTERNAL_IP -u root -p -P 32001 petclinic < spring-petclinic-customers-service/src/main/resources/db/mysql/schema.sql
mysql -h $EXTERNAL_IP -u root -p -P 32001 petclinic < spring-petclinic-visits-service/src/main/resources/db/mysql/schema.sql
mysql -h $EXTERNAL_IP -u root -p -P 32001 petclinic < spring-petclinic-vets-service/src/main/resources/db/mysql/schema.sql
mysql -h $EXTERNAL_IP -u root -p -P 32001 petclinic < spring-petclinic-customers-service/src/main/resources/db/mysql/data.sql
mysql -h $EXTERNAL_IP -u root -p -P 32001 petclinic < spring-petclinic-visits-service/src/main/resources/db/mysql/data.sql
mysql -h $EXTERNAL_IP -u root -p -P 32001 petclinic < spring-petclinic-vets-service/src/main/resources/db/mysql/data.sql
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: api-gateway
labels:
app: spring-petclinic
spec:
strategy:
type: Recreate
template:
from machine import Pin
from machine import PWM
import time
B0 = 31; C1 = 33; CS1 = 35; D1 = 37; DS1 = 39; E1 = 41; F1 = 44; FS1 = 46; G1 = 49; GS1 = 52; A1 = 55; AS1 = 58; B1 = 62;
C2 = 65; CS2 = 69; D2 = 73; DS2 = 78; E2 = 82; F2 = 87; FS2 = 93; G2 = 98; GS2 = 104; A2 = 110; AS2 = 117; B2 = 123; C3 = 131;
CS3 = 139; D3 = 147; DS3 = 156; E3 = 165; F3 = 175; FS3 = 185; G3 = 196; GS3 = 208; A3 = 220; AS3 = 233; B3 = 247; C4 = 262; CS4 = 277;
D4 = 294; DS4 = 311; E4 = 330; F4 = 349; FS4 = 370; G4 = 392; GS4 = 415; A4 = 440; AS4 = 466; B4 = 494; C5 = 523; CS5 = 554; D5 = 587;
DS5 = 622; E5 = 659; F5 = 698; FS5 = 740; G5 = 784; GS5 = 831; A5 = 880; AS5 = 932; B5 = 988; C6 = 1047; CS6 = 1109; D6 = 1175; DS6 = 1245;
E6 = 1319; F6 = 1397; FS6 = 1480; G6 = 1568; GS6 = 1661; A6 = 1760; AS6 = 1865; B6 = 1976; C7 = 2093; CS7 = 2217; D7 = 2349; DS7 = 2489; E7 = 2637;