Skip to content

Instantly share code, notes, and snippets.

@aterreno
aterreno / sp_generate_inserts.sql
Last active May 12, 2021 10:17
Amazing SQL Script to generate 'SQL inserts' for a MSSQL database - orginally by Narayana "Vyas" Kondreddi
SET NOCOUNT ON
GO
PRINT 'Using Master database'
USE master
GO
PRINT 'Checking for the existence of this procedure'
IF (SELECT OBJECT_ID('sp_generate_inserts','P')) IS NOT NULL --means, the procedure already exists
BEGIN
@aterreno
aterreno / cloner.sh
Created January 6, 2021 09:46
Clones all repos in an org, needs an auth token
function cloner {
curl -H "Authorization: token $1" -s "https://api.github.com/orgs/$2/repos?per_page=1000" \
| sed -n '/"ssh_url"/s/.*ssh_url": "\([^"]*\).*/\1/p' \
| sort -u \
| xargs -n1 git clone;
}
@aterreno
aterreno / even.js
Created December 16, 2020 19:19
https://coderpad.io/sandbox in javascript with mocha tests
const Mocha = require ('mocha')
const assert = require('chai').assert
const mocha = new Mocha ({ui: 'bdd'})
mocha.suite.emit('pre-require', this, 'solution', mocha)
const even = (n) => n % 2 === 0;
describe('Test suite', () => {
it('should work', () => {
@aterreno
aterreno / athena.sql
Last active March 24, 2020 23:31
How to automatically create CloudWatch alerts with CloudTrail, Lambda, and Serverless
SELECT DISTINCT eventname
FROM cloudtrail_logs_chargedup_cloudtrail
@aterreno
aterreno / index.js
Last active September 10, 2019 17:43
serverless-http & iopipe
const serverless = require("serverless-http");
const express = require("express");
const app = express();
// require("express-async-errors");
app.get("/hello", function(_req, res, _next) {
console.log("Hello, World");
try {
res.status(200).json({
@aterreno
aterreno / scrum_master.sh
Last active May 10, 2019 14:39
Scrum Master
#!/usr/bin/env bash
set -euf -o pipefail
scrum=("What did you work on yesterday?" "What are you going to work on today?" "Any blockers?" "Good progress" "Well done" "Any update on this?")
RANDOM=$$$(date +%s)
selected=${scrum[$RANDOM % ${#scrum[@]} ]}
say $selected
@aterreno
aterreno / Brewfile
Created January 14, 2019 09:04
Brewfile @ Work Laptop
tap "concourse/tap"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core"
brew "autojump"
brew "python"
brew "awscli"
brew "base64"
brew "ccat"
brew "dockutil"
@aterreno
aterreno / cloudSettings
Created October 26, 2018 08:14
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-10-26T08:14:32.613Z","extensionVersion":"v3.2.0"}
### Keybase proof
I hereby claim:
* I am aterreno on github.
* I am aterreno (https://keybase.io/aterreno) on keybase.
* I have a public key ASDyN280WSSo-gmnCpFj-LyLFpCn7KjU9-sdbdV6p0CqmQo
To claim this, I am signing this object:
@aterreno
aterreno / sample.png
Created January 30, 2018 09:47 — forked from jirutka/sample.png
Nested numbered list with correct indentation in CSS. Live example at http://jsfiddle.net/a84enL8k/.
sample.png