Skip to content

Instantly share code, notes, and snippets.

@pcarrier
pcarrier / _example.lua
Last active June 24, 2024 21:30
HTML markup DSL for Lua
local m = require('markup')
print('<!doctype html>', m.html{
lang = 'en',
m.head{
m.title 'markup.lua',
m.meta{ charset = 'utf-8' },
m.meta{ name = 'viewport', content = 'width=device-width, initial-scale=1' },
},
m.body {
package main
import (
"encoding/base64"
"errors"
"fmt"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
"github.com/fxamacker/cbor/v2"
"golang.org/x/crypto/nacl/sign"
"math"

Keybase proof

I hereby claim:

  • I am pcarrier on github.
  • I am pierre (https://keybase.io/pierre) on keybase.
  • I have a public key ASCylU4ZFkw4nZuiIER-aKrezWyOEHZd9phPrna62tvSvAo

To claim this, I am signing this object:

We couldn’t find that file to show.

Keybase proof

I hereby claim:

  • I am pcarrier on github.
  • I am pierre (https://keybase.io/pierre) on keybase.
  • I have a public key whose fingerprint is B0D5 888D C825 E637 640B 58A8 0355 26F2 EBE4 EA5A

To claim this, I am signing this object:

@pcarrier
pcarrier / $profile .ps1
Last active April 2, 2021 19:30
Windows setup
function safe { Set-Variable WhatIfPreference $true -Scope Global };
function unsafe { Set-Variable WhatIfPreference $false -Scope Global -WhatIf:$false };
function isAdmin {
$user = [Security.Principal.WindowsIdentity]::GetCurrent();
(New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator);
}
function shell { Start-Process powershell -WorkingDirectory $PWD -ArgumentList "-NoLogo" };
function admin { Start-Process powershell -ArgumentList "-NoLogo" -Verb RunAs };
#!/usr/bin/env ruby
OPS = [:+, :-, :*, :/]
ALL_OPS = OPS.product(OPS).product(OPS).map do |n| n.flatten end
ALL_FOUR_CARDS = (0..9999).map do |n|
a = n % 10 + 1
b = n/10 % 10 + 1
c = n/100 % 10 + 1
d = n/1000 % 10 + 1
resource "aws_iam_user" "asg_healthreport" {
name = "${var.stack}-asg_healthreport"
# can't use create_before_destroy due to fixed name
}
resource "aws_iam_access_key" "asg_healthreport" {
user = "${aws_iam_user.asg_healthreport.name}"
# can't use create_before_destroy due to fixed name of user
}
@pcarrier
pcarrier / gist:7b53fd39886aea8d5c77
Last active March 6, 2016 03:25
useful kernel remotes
[remote "stable"]
url = https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable.git
url = git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
fetch = +refs/heads/*:refs/remotes/stable/*
[remote "mainline"]
url = https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux.git
url = git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
fetch = +refs/heads/*:refs/remotes/mainline/*
[remote "history"]
url = https://kernel.googlesource.com/pub/scm/linux/kernel/git/history/history.git
@pcarrier
pcarrier / 0_reuse_code.js
Created October 18, 2015 17:04
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console