Skip to content

Instantly share code, notes, and snippets.

@seanrclayton
seanrclayton / util.go
Created December 9, 2022 00:23 — forked from schwarzeni/util.go
[golang] get specific network interface's IPv4 address
package util
import (
"errors"
"fmt"
"net"
)
// useful links:
// https://stackoverflow.com/questions/27410764/dial-with-a-specific-address-interface-golang
@seanrclayton
seanrclayton / signing-git-commits.md
Created November 30, 2022 22:55 — forked from phortuin/signing-git-commits.md
Set up a GPG key for signing Git commits on MacOS (M1)

Based on this blogpost.

To sign Git commits, you need a gpg key. GPG stands for GNU Privacy Guard and is the de facto implementation of the OpenPGP message format. PGP stands for ‘Pretty Good Privacy’ and is a standard to sign and encrypt messages.

Setting up

Install with Homebrew:

$ brew install gpg
edit
/etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=http://yum.kubernetes.io/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
Italian Text
Nessun dorma! Nessun dorma!
Tu pure, o, Principessa,
nella tua fredda stanza,
guardi le stelle
che tremano d'amore
e di speranza.
Ma il mio mistero è chiuso in me,
il nome mio nessun saprà!
No, no, sulla tua bocca lo dirò
One of the great mysteries of Christianity is the concept of the Trinity. While there is only one God in Christianity, there are three "persons" (Father, Son, Holy Spirit) that still add up to one God.
Create a God class whose instances always add up to 1. This isn't as easy as it sounds! If you get stuck on a Fixnum coersion error, here's some good reading:
http://www.mutuallyhuman.com/blog/2011/01/25/class-coercion-in-ruby/
Dir.glob('/var/local/project/logs/**').delete_if{|item| item.match(/\.gz/)}.each do |file|
if File.stat(file).size / 1048576 > 100
last_lines = IO.readlines(file).last(1000).join
File.open(file, 'w') {|f| f.write(last_lines); f.close}
end
end
sean.r.clayton@gmail.com
1:18 oh
1:18 i work at a company called Indeed.
Petie
1:19 i know, my brain just wasn't fully operational
sean.r.clayton@gmail.com
1:19 You want this, dont you?
1:19 I can FEEL your anger
@seanrclayton
seanrclayton / Gemfile.lock
Last active August 29, 2015 14:17
Gemfile.lock
GIT
remote: git://github.com/kalleth/spree_gift_card.git
revision: 8247fe88732f263049ac73c3bd13ee1b13030299
branch: 2-4-stable-initforthe
specs:
spree_gift_card (1.0.0.beta)
durable_decorator (~> 0.2.0)
spree_api (~> 2.4.0)
spree_backend (~> 2.4.0)
spree_core (~> 2.4.0)
---
some_attribute:
describes_more:
- blue
- green
- other_thing_nested:
-round
-offer
second_thing:
- more shit
class Triangle(object):
number_of_sides = 3
def __init__(self, angle1, angle2, angle3):
angle1 = self.angle1
angle2 = self.angle2
angle3 = self.angle3
def check_angles(self):
if self.angle1 + self.angle2 + self.angle3 == 180:
return True