Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
working . . .

opswhisperer

:octocat:
working . . .
View GitHub Profile
@fastjack
fastjack / Additional configuration for Telegraf
Last active Oct 15, 2021
Quick and dirty gateway metrics for telegraf on pfSense
View Additional configuration for Telegraf
[[inputs.exec]]
commands = ["/usr/local/libexec/telegraf/gateways.py"]
timeout = "5s"
data_format = "influx"
@opswhisperer
opswhisperer / BranchSmartBanner.html
Last active Dec 30, 2015
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
View BranchSmartBanner.html
<!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) {
View Init Bool With Int.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
@lttlrck
lttlrck / gist:9628955
Created Mar 18, 2014
rename git branch locally and remotely
View gist:9628955
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