Skip to content

Instantly share code, notes, and snippets.

View shsteven's full-sized avatar

Steven Zhang shsteven

View GitHub Profile
@codetricity
codetricity / theta_v_discover.py
Last active November 8, 2019 08:07
Ricoh THETA V client mode WiFi discovery for use with companion script to run WiFi API to control camera
#!/usr/bin/env python3
""" Example of browsing for a service (in this case, HTTP) """
import logging
import socket
import sys
from time import sleep
from zeroconf import ServiceBrowser, ServiceStateChange, Zeroconf
@codetricity
codetricity / theta_client_mode.py
Created February 26, 2018 22:54
THETA V Client Mode Test Script using Digest Authentication
"""
Test for THETA V client mode. Your workstation and the THETA V need to be
connected to the same WiFi router.
This test script uses Python modules requests and pprint.
To install requests and pprint
$ pip install requests
$ pip install pprint
Once connected with WiFi, use the API here:
@carlosedp
carlosedp / docker-compose.yml
Created January 19, 2018 14:35
docker-compose.yml - Traefik and Portainer
version: '2'
networks:
monitoring:
services:
traefik:
image: traefik:v1.5.0-rc5
restart: always
@DieterReuter
DieterReuter / user-data-wifi.yml
Created October 31, 2017 11:08
HypriotOS cloud-init configuration for RPi3 WiFi Client
#cloud-config
# vim: syntax=yaml
#
# The current version of cloud-init in the Hypriot rpi-64 is 0.7.9
# When dealing with cloud-init, it is SUPER important to know the version
# I have wasted many hours creating servers to find out the module I was trying to use wasn't in the cloud-init version I had
# Documentation: http://cloudinit.readthedocs.io/en/0.7.9/index.html
# Set your hostname here, the manage_etc_hosts will update the hosts file entries as well
import Foundation
import SceneKit
let json = """
{
"position": [2.0, 5.0, 3.0],
"rotation": [0.0, 0.73, 0.0, 0.73]
}
""".data(using: .utf8)!
@posener
posener / go-shebang-story.md
Last active March 15, 2025 16:08
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

import UIKit
class ResponsiveView: UIView {
override var canBecomeFirstResponder: Bool {
return true
}
}
class ViewController: UIViewController {
@christopheranderton
christopheranderton / update-outdated-brew-casks.sh
Last active March 17, 2025 14:04
Upgrade outdated brew casks. One liner, and the ”official” way to do it without using different hacks or scripts. However, it does not really replace some scripts out there, as in-app updates is not seen by Homebrew.
# Upgrade / Update outdated casks installed.
# --------------------------------------------------------------------------------
# Looks for outdated casks and installs the the latest version.
# User data (like application preferences) is intact.
# Updated one liner (thanks Henrik242)
# --------------------------------------------------------------------------------
brew upgrade $(brew outdated --cask --greedy --quiet)
@Funi1234
Funi1234 / Xcode Server Slack Notification
Last active November 30, 2016 05:21
xcodeSlack.sh
#!/bin/sh
#
# Created by Funi1234 on 30/06/2016.
#
if [ -z "$1" ]; then
echo "Slack Webhook URL Required."
echo "Exiting"
@egamma
egamma / .eslintrc.json
Created February 25, 2016 21:57
Visual Studio Code default .eslintrc.json
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true