This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
STATUS=$(echo pow 0|cec-client -s -d 1|grep power\ status|sed 's/.*: //') | |
if ! grep -i apple /proc/bus/input/devices && [[ ${STATUS} == on ]] ;then | |
sudo /bin/hciconfig hci0 up | |
echo "on" > /tmp/xxx | |
elif grep apple /proc/bus/input/devices && [[ ${STATUS} != on ]] ;then | |
sudo /bin/hciconfig hci0 down | |
echo "off" > /tmp/xxx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.min.js"></script> | |
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/js-yaml/3.7.0/js-yaml.min.js"></script> | |
<script type="text/javascript"> | |
var app = angular.module("Test", []); | |
app.controller("T", ['$scope', '$http', function($scope, $http) { | |
var res = $http.get('config/frack.yaml'); | |
res.then(function succesCB(r) { | |
yaml = jsyaml.load(r.data);; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from stravalib.client import Client | |
from flask import Flask | |
from flask import request | |
from flask import redirect | |
app = Flask(__name__) | |
client = Client() | |
access_token = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package server | |
import ( | |
"log" | |
"os" | |
"github.com/davecgh/go-spew/spew" | |
) | |
func Debug(a ...interface{}) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func debugVargs(args ...interface{}) { | |
fmt.Printf("(") | |
cnt := 1 | |
for _, v := range args { | |
fmt.Printf("'%s'", v) | |
if cnt != len(args) { | |
fmt.Printf(", ") | |
} | |
cnt += 1 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ex | |
project=$1 | |
[[ -z ${project} ]] && { | |
echo "Need a project name" | |
exit 1 | |
} | |
[[ -d ${project} ]] && { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Just use ff-find-other-file instead | |
(defun go-switch-test-and-back () | |
(interactive) | |
(let ((ext (file-name-extension (buffer-file-name))) | |
(base-fname | |
(file-name-sans-extension buffer-file-name)) | |
target) | |
(if (string-match "_test\\'" base-fname) | |
(setq target (concat (replace-regexp-in-string | |
"_test\\'" "" base-fname) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package utils | |
import ( | |
"crypto/rand" | |
"encoding/hex" | |
"fmt" | |
"log" | |
"os" | |
"path/filepath" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ef | |
# dont put slash at the end or that would fail | |
URL="" | |
TOKEN=$(curl -f -k -s -k "${URL}/auth/realms/master/protocol/openid-connect/token" -H "Content-Type: application/x-www-form-urlencoded" -d "username=admin" -d 'password=admin' -d 'grant_type=password' -d 'client_id=admin-cli'|python -c 'import sys, json; print json.load(sys.stdin)["access_token"]') | |
curl -f -s -k "${URL}/auth/admin/realms" -H "Accept: application/json" -H "Authorization: Bearer $TOKEN" | python -mjson.tool | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/controller/controller.go b/controller/controller.go | |
index f2b6cfd9..93765503 100644 | |
--- a/controller/controller.go | |
+++ b/controller/controller.go | |
@@ -1,6 +1,7 @@ | |
package controller | |
import ( | |
+ "crypto/tls" | |
"encoding/json" |