Skip to content

Instantly share code, notes, and snippets.

View LarsFronius's full-sized avatar
:octocat:

Lars Fronius LarsFronius

:octocat:
View GitHub Profile
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
building openstack lab:
There are a few dependencies:
- ruby, virtualbox, ubuntu precise base box, vagrant, puppet modules, librarian-puppet
find the module on stackforge:
> git clone https://github.com/stackforge/puppet-openstack_dev_env
@MattSurabian
MattSurabian / PackerPolicy.json
Last active May 27, 2022 21:46
Minimum IAM policy required by AWS for Packer to do its thing. https://github.com/mitchellh/packer Permissions are broken out by API functionality and a resource array has been defined with a wild card for each group. For tighter security resource level permissions can be applied per this documentation: http://aws.typepad.com/aws/2013/07/resourc…
{
"Statement": [
{
"Sid": "PackerSecurityGroupAccess",
"Action": [
"ec2:CreateSecurityGroup",
"ec2:DeleteSecurityGroup",
"ec2:DescribeSecurityGroups",
"ec2:AuthorizeSecurityGroupIngress",
"ec2:RevokeSecurityGroupIngress"
@domenic
domenic / 0-github-actions.md
Last active May 26, 2024 07:43
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with GitHub Actions

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:

  • It is much easier and requires less steps, because you are already authenticated with GitHub, so you don't need to share secret keys across services like you do when coordinate Travis CI and GitHub.
  • It is free, with no quotas.
  • Anecdotally, builds are much faster with GitHub Actions than with Travis CI, especially in terms of time spent waiting for a builder.
@ericlagergren
ericlagergren / index.gohtml
Last active December 22, 2023 17:51
Hot-reloading / hot-swapping live template files in Go
My name is {{.Name}} and I'm {{.Age}} years old!!
anonymous
anonymous / GAME_MASTER_v0_1.protobuf
Created July 16, 2016 16:31
Pokemon Go decoded GAME_MASTER protobuf file v0.1
Result: 1
Items {
TemplateId: "BADGE_BATTLE_ATTACK_WON"
Badge {
BadgeType: BADGE_BATTLE_ATTACK_WON
BadgeRanks: 4
Targets: "\nd\350\007"
}
}
Items {

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@stevenringo
stevenringo / deploy_stack.sh
Created September 11, 2017 00:13
Create/update/delete cloudformation stacks with events tailing
set -o pipefail
_exit_error() {
message=$1
code=$2
echo "$message" >&2
exit $code
}
_exit_ok() {
@miguelcnf
miguelcnf / rollback.go
Last active January 29, 2021 20:56
Idiomatic, simple, defer-based rollback mechanism https://play.golang.org/p/p28rpnpiUcL
package main
import (
"errors"
"log"
)
// rollback function
func rollback(rollbackCtrl *bool, rollbackFunc func()) {
if *rollbackCtrl {
@jriquelme
jriquelme / elastic_sample.go
Created November 29, 2019 15:14
Signing of Elastic requests (https://github.com/elastic/go-elasticsearch) according to AWS v4 Signing process
cfg, err := external.LoadDefaultAWSConfig()
if err != nil {
panic(err)
}
esCfg := elasticsearch.Config{
Transport: &awssigner.V4Signer{
RoundTripper: http.DefaultTransport,
Credentials: cfg.Credentials,
Region: cfg.Region,
},