Skip to content

Instantly share code, notes, and snippets.

View jlindsey's full-sized avatar
🐢

Josh Lindsey jlindsey

🐢
View GitHub Profile
@jlindsey
jlindsey / smarter_conditional_get.rb
Last active June 15, 2023 22:14
Adds assets and view digests to Rails 4 etags calculation
# Adds assets and view to the etags calculation
module SmarterConditionalGet
extend ActiveSupport::Concern
included do
# Add assets digest to etag
etag { Rails.application.assets.digest.to_s }
# Add a random value to the etag in dev to bust the cache
etag { rand if Rails.env.development? }
# Ansible EC2 external inventory script settings
#
[ec2]
# to talk to a private eucalyptus instance uncomment these lines
# and edit edit eucalyptus_host to be the host name of your cloud controller
#eucalyptus = True
#eucalyptus_host = clc.cloud.domain.org
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>