Skip to content

Instantly share code, notes, and snippets.

View opswhisperer's full-sized avatar
:octocat:
working . . .

Rob opswhisperer

:octocat:
working . . .
View GitHub Profile
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@fastjack
fastjack / Additional configuration for Telegraf
Last active December 4, 2022 13:14
Quick and dirty gateway metrics for telegraf on pfSense
[[inputs.exec]]
commands = ["/usr/local/libexec/telegraf/gateways.py"]
timeout = "5s"
data_format = "influx"
@JadenGeller
JadenGeller / Init Bool With Int.swift
Created March 23, 2015 07:48
Cast Int to Bool in Swift
extension Bool {
init<T : IntegerType>(_ integer: T){
self.init(integer != 0)
}
}
// Now you can do this
let x = Bool(5) // true
let y = Bool(-1) // true
let z = Bool(0) // false
@opswhisperer
opswhisperer / BranchSmartBanner.html
Last active December 30, 2015 08:47
Here's how you get the Branch smart banned to pull your ratings from the AppStore automatically. https://www.devilhornsoftware.com/blog/2015/12/30/a-smarter-smart-banner
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Branch.io Smart Banner</title>
<script type="text/javascript">
var ratingCount, averageUserRating, appID, branchKey;
appID = "284882215";
branchKey = "YOUR_API_KEY"
function getRating(content) {