Skip to content

Instantly share code, notes, and snippets.

View billyxs's full-sized avatar

Billy Montgomery billyxs

View GitHub Profile
@billyxs
billyxs / aws-cloudwatch-delete-alarms.sh
Last active August 22, 2023 14:56
Delete a list of cloudwatch alarms with names that contain a string
#!/bin/bash
ALARM_NAME_CONTAINS_STRING='alarm-name'
ALARMS=$(aws cloudwatch describe-alarms \
| jq '.MetricAlarms[].AlarmName' \
| sed "s/\"//g" \
| awk "/$ALARM_NAME_CONTAINS_STRING/")
for alarm in $ALARMS;
@billyxs
billyxs / .bash_aliases
Created April 18, 2019 16:51 — forked from vratiu/.bash_aliases
Git shell coloring
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
@billyxs
billyxs / readme.md
Created February 27, 2018 22:02 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"

npm adduser

@billyxs
billyxs / gist:fe453750fcf220d3c63d9b5a20775565
Created February 4, 2018 06:02 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@billyxs
billyxs / git-change-commit-messages.md
Created January 25, 2018 16:20 — forked from nepsilon/git-change-commit-messages.md
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

@billyxs
billyxs / angular_processing_button_directive.js
Last active October 14, 2015 17:55
Angular directive for a button that shows an animation when "processing". Good for when a form is being posted, and the user is waiting for a result
// Requires font-awesome for spinning functionality
angular.module('buttonUtils')
.directive('processingButton', function() {
return {
scope: {
buttonText:"@",
buttonProcessing: "="
},
link: function(scope, element, attrs) {
@billyxs
billyxs / file_input_with_accessibility.html
Last active September 24, 2015 15:44
Styled file input button with accesibility
<!-- Solution as found in - http://tympanus.net/codrops/2015/09/15/styling-customizing-file-inputs-smart-way/ -->
<style>
.inputfile {
width: 0.1px;
height: 0.1px;
opacity: 0;
overflow: hidden;
position: absolute;
z-index: -1;
@billyxs
billyxs / crypto-pbkdf2-auth-example.js
Last active October 11, 2020 16:50
CryptoJS PBKDF2 hashing with javascript. This could be used for a simple, not high security, password auth.
// bower install crypto-js
// Add to scripts to html file
// <script src="bower_components/crypto-js/crypto-js.js"></script>
// <script src="bower_components/crypto-js/pbkdf2.js"></script>
function auth(password) {
// Make a salt with CryptoJS.lib.WordArray.random(128/8);
var salt = 'your salt'; // CryptoJS.lib.WordArray.random(128/8);
// 1000 iterations takes a couple seconds in the browser. Wouldn't want to go much higher if this is a browser implementation
@billyxs
billyxs / states_list_with_DC_object_literal.js
Last active October 13, 2015 17:46
Javascript list of 50 states with DC using object literal syntax
[
{
name: 'Alabama',
abbreviation: 'AL',
id: 'AL'
},
{
name: 'Alaska',
abbreviation: 'AK',
id: 'AK'
@billyxs
billyxs / states.json
Last active September 17, 2015 21:44
United States with DC using abbreviation for id
[
{
"name": "Alabama",
"abbreviation": "AL",
"id": "AL"
},
{
"name": "Alaska",
"abbreviation": "AK",
"id": "AK"