Skip to content

Instantly share code, notes, and snippets.

View danopia's full-sized avatar

Daniel Lamando danopia

View GitHub Profile
apiVersion: batch/v1
kind: Job
metadata:
name: push-lambdabot
labels:
purpose: build
spec:
ttlSecondsAfterFinished: 30
template:
spec:
@danopia
danopia / hal-config-patch.yaml
Created May 24, 2019 18:19
spinnaker sizing (for a couple dozen cloud providers)
# by default, halyard doesn't set any k8s sizing. do our own
deploymentConfigurations[0].deploymentEnvironment.customSizing:
# replicate most deployments
spin-gate:
replicas: 2
spin-deck:
replicas: 2
spin-front50:
replicas: 2
@danopia
danopia / push-dust-server.yaml
Last active May 21, 2019 00:37
one-command kubernetes application build&deploy
apiVersion: batch/v1
kind: Job
metadata:
name: push-dust-server
labels:
purpose: build
spec:
ttlSecondsAfterFinished: 30
template:
spec:
@danopia
danopia / solar.js
Created April 8, 2019 16:51
JavaScript file to calculate the sun's position for given Earth coordinates + Date object
/* solar.js -- Solar position ported source
This file was a part of Redshift.
Redshift is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Redshift is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@danopia
danopia / fetcher.coffee
Last active April 3, 2019 06:25
Withboard Google Drive Slideshow
{folderId, userId} = @config
return unless folderId and userId
return unless user = Meteor.users.findOne userId
{assets_s3_bucket} = Meteor.settings.public
parts = assets_s3_bucket.split '/'
if parts[2] isnt 's3.amazonaws.com'
throw new Error 'Weird S3 bucket'
Bucket = parts[3]
AssetPrefix = parts.slice(4).join('/')
@danopia
danopia / 1_floating.go
Last active December 1, 2023 03:20
examples of adding a title to olekukonko/tablewriter in post
package main
import (
"fmt"
"strings"
"github.com/google/uuid"
"github.com/olekukonko/tablewriter"
)
@danopia
danopia / gist:dd2d5ed4ddec3467dd5f0b92d46b42cd
Created March 1, 2019 01:37
openbsd 6.5-beta relayd websocket patch
diff -u -p -r1.71 relay_http.c
--- relay_http.c 6 Aug 2018 17:31:31 -0000 1.71
+++ relay_http.c 1 Mar 2019 01:33:35 -0000
@@ -276,6 +276,13 @@ relay_read_http(struct bufferevent *bev,
DPRINTF("http_version %s http_rescode %s "
"http_resmesg %s", desc->http_version,
desc->http_rescode, desc->http_resmesg);
+
+ // HTTP 101 Switching Protocols
+ if (desc->http_status == 101) {
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.SceneManagement;
using Random = UnityEngine.Random;
[RequireComponent(typeof(Rigidbody))]
public class PhysicalGolfball : MonoBehaviour
@danopia
danopia / pie.html
Last active February 2, 2019 01:00
coffeescript pie chart svg renderer
<svg viewBox="-1 -1 2 2" style="transform: rotate(-90deg)">
{{#each pieSlices}}
<path d={{pathData}} fill={{color}}></path>
{{/each}}
</svg>
@danopia
danopia / weather.txt
Last active January 28, 2019 03:57
stream subtitles from live tv broadcast (mpegts) as srt format
~ $ curl http://192.168.86.49:5004/auto/v5.1 --silent \
| ffmpeg -nostdin -loglevel panic -f lavfi \
-i movie=/dev/stdin[out+subcc] -map 0:1 -f srt - \
| grep '</font>'
<font face="Monospace">{\an7}THE 2019 PRO BOWL</font>
PRESENT YOU GUYS THIS TROPHY.</font>
HERE YOU GO DOWN BELOW. YOU</font>
GOT IT. YOU GUYS GO. THERE WE</font>
GO GRADUATIONS GUYS. DID SHE</font>
COME JASON WIT WHEN THEY WORK</font>