Skip to content

Instantly share code, notes, and snippets.

View gillesdemey's full-sized avatar
♥️
Be kind to others

Gilles De Mey gillesdemey

♥️
Be kind to others
View GitHub Profile
@gillesdemey
gillesdemey / HOWTO.md
Last active March 22, 2024 17:33
Disable ASBL on LG C9 without service remote

Install dependencies

Go ahead and install https://github.com/chros73/bscpylgtv using pip install bscpylgtv or compile from source.

Run command to start the service menu

bscpylgtvcommand <your-TV-ip-address> launch_app_with_params com.webos.app.factorywin "{\"id\":\"executeFactory\", \"irKey\":\"inStart\"}"

Enter PIN

package main
import (
"context"
"github.com/oklog/run"
"log"
"syscall"
"time"
)
@gillesdemey
gillesdemey / go.mod
Last active March 20, 2023 12:13
Dicom writer
module github.com/gillesdemey/dicom-test
go 1.20
require (
github.com/suyashkumar/dicom v1.0.6 // indirect
golang.org/x/text v0.3.8 // indirect
)
@gillesdemey
gillesdemey / .drone.yml
Created May 29, 2017 10:02
Authenticate with gloud and kubectl in Drone
pipeline:
...
deploy:
image: google/cloud-sdk
commands:
- printenv KUBE_SERVICE_ACCOUNT > credentials.json
- gcloud auth activate-service-account --key-file=credentials.json
- "gcloud container clusters get-credentials $CLUSTER_NAME \
--zone $PROJECT_ZONE \
--project $PROJECT_NAME"
const SUFFIX_MULTIPLIER: Record<string, number> = {
'ms': 1,
's': 1000,
'm': 60 * 1000,
'h': 60 * 60 * 1000,
'd': 24 * 60 * 60 * 1000,
'w': 7 * 24 * 60 * 60 * 1000,
'y': 365 * 24 * 60 * 60 * 1000,
}
asm`addsubtractmemory
 j   k @nameaddsubtractp0p1p0p1t0 memory
@gillesdemey
gillesdemey / index.mjs
Last active June 27, 2021 16:55
Simple graph + walker
import graphlib from 'graphlib'
import { Walker } from './walk.mjs'
const { Graph, json } = graphlib
const graph = new Graph({ directed: true })
/* ┌───┐
* ┌▶│ 5 │───┐
* ┌───┐ ┌───┐ │ └───┘ │ ┌───┐
@gillesdemey
gillesdemey / querystring.swift
Last active March 24, 2021 10:53
Retrieve specific query string parameter from NSURL
func getQueryStringParameter(url: String, param: String) -> String? {
let url = NSURLComponents(string: url)!
return
(url.queryItems? as [NSURLQueryItem])
.filter({ (item) in item.name == param }).first?
.value()
}
@gillesdemey
gillesdemey / index.js
Last active February 7, 2021 02:21
express-jwt-permissions with express-unless
const express = require('express')
const jwt = require('express-jwt')
const permissions = require('express-jwt-permissions')()
const unless = require('express-unless')
const app = express()
const checkAuth = jwt({ secret: process.env.JWTSECRET })
const checkAdmin = permissions.check(['admin'])
checkAdmin.unless = unless
package main
import (
"fmt"
"golang.org/x/sync/errgroup"
"time"
)
func main() {
fmt.Println("Hello, world!")