Skip to content

Instantly share code, notes, and snippets.

View AlexZeitler's full-sized avatar
👷‍♂️
Building stuff

Alexander Zeitler AlexZeitler

👷‍♂️
Building stuff
View GitHub Profile
@veuncent
veuncent / aws_glacier_delete_vault.md
Last active March 19, 2024 18:16
Delete all archives in an AWS Vault

AWS Glacier: Delete vault

Follow these steps to remove all archives from an AWS vault. After this is finished, you will be able to delete the vault itself through the browser console.

Step 1 / Retrieve inventory

This will create a job that collects required information about the vault.

$ aws glacier initiate-job --job-parameters '{"Type": "inventory-retrieval"}' --account-id YOUR_ACCOUNT_ID --region YOUR_REGION --vault-name YOUR_VAULT_NAME 
@zcaceres
zcaceres / Error-Handling-Patterns-Express.md
Last active August 3, 2023 13:40
error handling patterns in Express

Handling Errors

Express.js makes it a breeze to handle errors in your routes.

Express lets you centralizes your error-handling through middleware.

Let's look at patterns for how to get the most out of your error-handling.

First, our error-handling middleware looks like this:

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@kevinswiber
kevinswiber / siren_api.yml
Last active September 7, 2022 21:02
Siren definitions for Open API Specification
swagger: '2.0'
info:
title: Siren API
description: Template for a Siren API
version: '0.1.0'
schemes:
- http
- https
basePath: /
produces:
@aliostad
aliostad / azure-vm-bootstrapper.ps1
Last active April 18, 2016 11:04
Azure VM bootstrapper
# Usage:
# iex ((new-object net.webclient).DownloadString('https://gist.githubusercontent.com/aliostad/a20f0c8d6a439dcff34e63e4a6559008/raw/0e445d869eb47e525512053638489920547a7d75/azure-vm-bootstrapper.ps1'))
# Bootstraps the Azure VM by modyifying settings and installing below:
# 1. Turn off annoying Intrenet Explorer enhanced security
# 2. Install chocolatey
# 3. Install PerfView
# 4. Install DebugView
# 5. Install SuperBenchmarker
# 6. Install notepad++
# 7. Install windbg
@makomweb
makomweb / csharp_implicit_type_conversion.cs
Last active August 29, 2015 13:56
C# implicit type conversion (see http://msdn.microsoft.com/en-us/library/zk2z37d3.aspx for a more detailed explanation)
public class ImplicitConversionTest
{
public class A
{
public string Member { get; set; }
public static implicit operator string(A self)
{
return self.Member;
}
@kagemusha
kagemusha / gist:5866759
Created June 26, 2013 11:37
Using Debugger with Grunt
version: grunt-cli v0.1.8
1. Install node-inspector globally (-g)
npm install -g node-inspector
2. Add debugger statements to your code
3. Run your grunt task in debug mode
@jimothyGator
jimothyGator / README.md
Last active April 25, 2024 18:00
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
@michaelcox
michaelcox / SpecRunner.js
Last active January 11, 2024 06:05
Browser Unit Testing with Backbone Mocha Chai and RequireJS
require.config({
baseUrl: '/backbone-tests/',
paths: {
'jquery' : '/app/libs/jquery',
'underscore' : '/app/libs/underscore',
'backbone' : '/app/libs/backbone',
'mocha' : 'libs/mocha',
'chai' : 'libs/chai',
'chai-jquery' : 'libs/chai-jquery',
'models' : '/app/models'
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Raven.Client.Document;
namespace OurNamespace
{
public sealed class RavenStore :IDisposable
{