Skip to content

Instantly share code, notes, and snippets.

View Superbil's full-sized avatar
:shipit:
Working in Cloud

Superbil Superbil

:shipit:
Working in Cloud
View GitHub Profile
@gausby
gausby / advice-flyspell-auto-correct-word-to-read-out-loud.el
Last active November 14, 2017 15:41
Custom flyspell-insert-function that will read the word out loud
;; Read the inserted word out loud using the macOS speech synthesizer
;; when a misspelled word is corrected using the flyspell
;; `flyspell-auto-correct-word'-command.
;;
;; Note this only work on macOS. It should be fairly easy to change to
;; work with other command line interface speech synthesize systems.
;;
;; In a previous version this used to be a defadvice, but I've changed
;; it to implementing a custom flyspell insert function. This seems to
;; work a bit more reliably.
@ruanbekker
ruanbekker / docker-nfs-volumes.md
Created December 10, 2017 10:43
NFS Volumes with Docker Swarm

Create NFS Volumes:

Creating the NFS Volume:

$ docker volume create --driver local \
  --opt type=nfs \
  --opt o=addr=192.168.1.115,uid=1000,gid=1000,rw \
  --opt device=:/mnt/volumes/mysql-test \
  mysql-test-1
@bobchao
bobchao / m_test.txt
Created December 22, 2017 14:08
cubiio - g-code file for power / speed combinations testing.
M05 S0
G90
G21
G1 F600
G1 X-40.225 Y39.6688
G4 P0
M03 S255
G4 P0
G1 F600.000000
@enricofoltran
enricofoltran / main.go
Last active April 6, 2025 09:48
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@htruong
htruong / chroot-to-pi.sh
Last active March 24, 2025 06:06
Chroot to pi sd card
#!/bin/bash
# This script allows you to chroot ("work on")
# the raspbian sd card as if it's the raspberry pi
# on your Ubuntu desktop/laptop
# just much faster and more convenient
# credits: https://gist.github.com/jkullick/9b02c2061fbdf4a6c4e8a78f1312a689
# make sure you have issued
@scjody
scjody / tramp-gcloud-ssh
Created February 5, 2018 18:16
EMACS TRAMP setup for "gcloud compute ssh"
;; TRAMP gcloud ssh
(add-to-list 'tramp-methods
'("gssh"
(tramp-login-program "gssh")
(tramp-login-args (("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
("-o" "UserKnownHostsFile=/dev/null")
import Cocoa
import MapKit
class MultilineCluster: NSObject, MKOverlay {
var coordinate: CLLocationCoordinate2D
var boundingMapRect: MKMapRect
var lines: [[MKMapPoint]] = []
var strokeColor: NSColor = .black
init(coords: [[CLLocationCoordinate2D]]) {
@bcherny
bcherny / Option.ts
Last active July 9, 2019 22:52
Draft: Reference Option implementation for Programming TypeScript
function Option<T>(value?: null | undefined): None
function Option<T>(value: T): Some<T>
function Option<T>(value?: T): Option<T> {
if (value == null) {
return new None
}
return new Some(value)
}
interface Option<T> {
@TheMetalCode
TheMetalCode / A_Way_To_Mostly_Automate_FastlaneSession_Update.md
Last active June 17, 2022 19:21
Mostly Automated Way to Update FASTLANE_SESSION

fastlane/fastlane#13833

This script may be useful to you if you use fastlane for iOS CI builds and your Apple developer portal account uses 2-factor authentication. There is reason to suppose that Apple may not be persisting these sessions for as long as they used to, and hence you might find yourself needing to update FASTLANE_SESSION for your CI projects more often than usual.

This script is a way to mostly automate the process of updating FASTLANE_SESSION if you use CircleCI as your CI provider. It expects to find your Apple username in env as FASTLANE_USER, your Apple password as FASTLANE_PASSWORD, and your CircleCI API token as CIRCLE_API_TOKEN. It then executes fastlane spaceauth and waits for you to put in your 2FA code. From there, it parses out the session data and then uses the CircleCI API to populate the specified projects with the newly updated FASTLANE_SESSION. You'll

@alexismp
alexismp / index.js
Last active November 8, 2022 21:58
Node.js 8 Cloud Function to write to a Google Sheets document
// Copyright 2018 Google LLC.
// SPDX-License-Identifier: Apache-2.0
const { google } = require("googleapis");
const { Storage } = require("@google-cloud/storage");
exports.csv2sheet = async (data, context) => {
var fileName = data.name;
// basic check that this is a *.csv file, etc...
if (!fileName.endsWith(".csv")) {