Skip to content

Instantly share code, notes, and snippets.

View LinusU's full-sized avatar
😅
Up to a few hundred notifications again, working thru them...

Linus Unnebäck LinusU

😅
Up to a few hundred notifications again, working thru them...
View GitHub Profile
@LinusU
LinusU / Flite_Sensor_Controller_DIY.md
Created November 26, 2023 14:17 — forked from DJMarlow/Flite_Sensor_Controller_DIY.md
Flite Keg Sensor and Controller DIY

FLITE KEG SENSOR AND CONTROLLER DIY

This DIY will walk you through the steps to build your own Flite keg sensor and controller. Before getting started, it's recommended that you have the following tools and skills:


TOOLS

  • Drill press with drill bits for stainless steel
  • Soldering iron
  • 3D printer
@LinusU
LinusU / generate.js
Last active September 22, 2023 19:44
Stripe TypeScript definition generation
const input = require('./spec3.json')
function titleCase(snake) {
return snake.replace(/(^|_)([a-z])/g, (s) => s.replace('_', '').toUpperCase())
}
function isPrimitive(schema) {
switch (schema.type) {
case 'boolean':
case 'number':
@LinusU
LinusU / DSP-W115.md
Created October 18, 2018 06:20
Information about the DSP-W115 Smart Plug

DSP-W115

The deice creates an ad-hoc network that will be named DSP-W115-XXXX (where XXXX will be device dependent). When connecting to this network, my Smart Plug had the address 192.168.0.20, navigating to http://192.168.0.20/ took me to a login page. The credentials for logging in were: username = Admin, password = pin code printed on device.

After logging in, the device presents a page with some current information about the device:

Firmware Version: 1.00-b11
Date: Nov 17, 2017
Checksum: 0x13A44B58
@LinusU
LinusU / README.md
Last active July 17, 2021 08:06 — forked from apla/icons_and_splash.js
Icons and Splash images for your Cordova project. (with iOS 7 support)

Usage

Install cordova into node_modules

npm install cordova

Add icons_and_splash.js

@LinusU
LinusU / Makefile
Created May 21, 2016 18:05
Minimal CoreAudio line in example
line-in:
clang++ darwin.cc -framework AudioToolBox -framework CoreFoundation -o line-in
@LinusU
LinusU / react.swift
Last active March 6, 2018 15:38
React like renderer concept for Swift
import UIKit
import PlaygroundSupport
/**********************************************
* Library Types *
**********************************************/
protocol REElement {
func render() -> REElement?
@LinusU
LinusU / uuid-v5.js
Created April 30, 2014 12:32
UUID V5 Node.js
function uuid5(data) {
var out = crypto.createHash('sha1').update(data).digest();
out[8] = out[8] & 0x3f | 0xa0; // set variant
out[6] = out[6] & 0x0f | 0x50; // set version
var hex = out.toString('hex', 0, 16);
return [
hex.substring( 0, 8),
function run () {
var updateButton = document.querySelector('.branch-action-btn button')
var mergeButton = document.querySelector('.merge-message button')
if (!mergeButton.disabled) {
mergeButton.click()
return
}
if (!updateButton.disabled) {
@LinusU
LinusU / api.js
Last active December 28, 2015 04:59
Eligius javascript api, backed by jsonp.
(function (window, document) {
'use strict';
var api = function (cmd, opts, cb) {
opts.cmd = cmd;
var id = 'APICB' + Math.round(Math.random() * 1e9),
@LinusU
LinusU / 0.1.0-115
Last active December 11, 2015 14:38
My nodejitsu errors
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
error: There was an error while attempting to deploy the app
error:
error: Target script does not exist: /opt/haibu/carapace-versions/0.8.16/node_modules/haibu-carapace/bin/carapace
error: Error output from Haibu:
error:
error: Error: Target script does not exist: /opt/haibu/carapace-versions/0.8.16/node_modules/haibu-carapace/bin/carapace
error: at /root/haibu-orchestra/node_modules/haibu/node_modules/forever-monitor/lib/forever-monitor/monitor.js:143:26
error: at process.startup.processNextTick.process._tickCallback (node.js:244:9)