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
@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")
@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
@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"
@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
@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
@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.
@ronnywang
ronnywang / log.md
Last active October 1, 2017 07:02
關於「著作權法增訂第八十四條之一條文草案」我與洪慈庸委員臉書的訊息

Ronny: 下面留言也有 Yutin 發文給洪慈庸的內容,也希望台灣能有越來越多人能去主動了解與自己切身相關立委提案,若是贊同,可以發文鼓勵立委,若是有疑慮或反對,也可以發文詢問提出問題點

2017/9/30 13:15 Ronny => 洪慈庸委員

洪委員您好,一直都很認同時代力量的理念,但是今天看到 http://lci.ly.gov.tw/LyLCEW/agenda1/02/pdf/09/04/01/LCEWA01_090401_00101.pdf 著作權法增訂第八十四條之 一條文草案 您有參與連署,想確認一下貴黨或是委員對於此案的了解。

我認同保障著作權是現代很重要的價值,但是草案中透過 IP 阻擋境外網站的作法,保護到了著作權,但是傷害到了更大的價值。將整個境外網站阻擋形同言論控制,侵害言論自由和通訊自由,這樣做形同保護了一個權利,但傷害了更多權利。

建議委員可以參考過去幾年美國 SOPA 法案提出時引發的爭論討論過程,會是個拿來思考,這次的著作權法修訂是否是恰當的。

import UIKit
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
@IBOutlet weak var tableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
NSLayoutConstraint.activate([
tableView.topAnchor.constraint(equalTo: view.topAnchor),
@Hokila
Hokila / NotificationViewController.swift
Created July 27, 2017 15:07
Put AVPlayerLayer on UserNotification, also add play pause button
/*
See LICENSE folder for this sample’s licensing information.
Abstract:
Contains ImageContentExtension's NotificationViewController.
*/
import UIKit
import UserNotifications
import UserNotificationsUI