Skip to content

Instantly share code, notes, and snippets.

View jlindsey's full-sized avatar
🐢

Josh Lindsey jlindsey

🐢
View GitHub Profile
package main
import (
"fmt"
"github.com/spf13/cobra"
)
var cmd = &cobra.Command{
Use: "cobratest",
@jlindsey
jlindsey / command
Last active September 23, 2020 19:53
❯ target/debug/hcl2 <<EOF | pbcopy
test block "label" {
a = 1.4e9
b = -73.19e-12
internal {
a = "test string here"
b = 5
c = 7.3
d = -3
"""
Deployment tasks for salt
"""
from __future__ import absolute_import
import io
import os
import tarfile
import time
@jlindsey
jlindsey / install_slack_dark_mode.sh
Last active March 11, 2019 14:19
Slack Dark Mode installer
#!/bin/bash
restart() {
osascript -l JavaScript <<EOF > /dev/null
var app = Application('$1')
if (app.running()) {
try { app.quit() } catch (e) {}
}
@jlindsey
jlindsey / token.go
Last active February 19, 2019 19:23
package main
import (
"crypto/rand"
"encoding/base64"
"fmt"
)
func main() {
buf := make([]byte, 64)
db.Update(func(tx *bolt.Tx) error {
var res error
buckets := [][]byte{
[]byte("permissions"),
[]byte("history"),
[]byte("schedules"),
}
for _, name := range buckets {
if _, err := tx.CreateBucketIfNotExists(name); err != nil {
<!doctype html>
<html>
<body>
<h1>Body</h1>
{{template "test"}}
</body>
</html>
<!doctype html>
<html>
<head><title>Arts!</title></head>
<body>
<h1>Some content</h1>
<p>Goes here</p>
{{template "content"}}
</body>
</html>
type AutoGenerated struct {
Expand string `json:"expand"`
StartAt int `json:"startAt"`
MaxResults int `json:"maxResults"`
Total int `json:"total"`
Issues []struct {
Expand string `json:"expand"`
ID string `json:"id"`
Self string `json:"self"`
Key string `json:"key"`
trait BoxedFn {
fn call_box(self: Box<Self>);
}
impl<F: FnOnce()> BoxedFn for F {
fn call_box(self: Box<F>) {
(*self)()
}
}