Skip to content

Instantly share code, notes, and snippets.

View AidenMontgomery's full-sized avatar

Aiden Montgomery AidenMontgomery

View GitHub Profile
@AidenMontgomery
AidenMontgomery / addSpecialRoleCommand.ts
Last active November 30, 2021 21:04
add-special-role slash command for devie-bot
import { SlashCommandBuilder } from '@discordjs/builders';
import { CommandInteraction, Message, MessageActionRow, MessageButton, Role, GuildMember } from 'discord.js';
import { SlashCommandConfig } from '../types';
class RoleLookup {
public existingRole: Role | undefined;
public targetRole: Role | undefined;
}
export const AddSpecialRoleCommand: SlashCommandConfig = {
@AidenMontgomery
AidenMontgomery / proxyconfig
Created July 28, 2016 05:55
Update all network interfaces to use the specified proxy settings.
proxy_hostname=localhost
proxy_port=5050
nics=$(networksetup -listnetworkserviceorder | awk '/\([0-9]\)/ {print $2"_"$3}')
for nic in $nics; do
nic="${nic/_/ }"
nic=$(echo "${nic}" | awk '{gsub(/^ +| +$/,"")} {print $0}')
sudo networksetup -setwebproxy "$nic" $proxy_hostname $proxy_port
@AidenMontgomery
AidenMontgomery / MainActivity.java
Last active January 8, 2016 17:24
The MainActivity I am seeing when creating a new react-native app
package com.androidmaptest;
import com.facebook.react.ReactActivity;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import java.util.Arrays;
import java.util.List;
public class MainActivity extends ReactActivity {

Keybase proof

I hereby claim:

  • I am aidenmontgomery on github.
  • I am aidenmontgomery (https://keybase.io/aidenmontgomery) on keybase.
  • I have a public key ASA0tupf2lrfOYq5vh57h6EhPslgL9WbRea-pS0_HDDy4wo

To claim this, I am signing this object:

#!/bin/bash
echo -e "\033[0mCOLOR_NC (No color)"
echo -e "\033[1;37mCOLOR_WHITE\t\033[0;30mCOLOR_BLACK"
echo -e "\033[0;34mCOLOR_BLUE\t\033[1;34mCOLOR_LIGHT_BLUE"
echo -e "\033[0;32mCOLOR_GREEN\t\033[1;32mCOLOR_LIGHT_GREEN"
echo -e "\033[0;36mCOLOR_CYAN\t\033[1;36mCOLOR_LIGHT_CYAN"
echo -e "\033[0;31mCOLOR_RED\t\033[1;31mCOLOR_LIGHT_RED"
echo -e "\033[0;35mCOLOR_PURPLE\t\033[1;35mCOLOR_LIGHT_PURPLE"
echo -e "\033[0;33mCOLOR_YELLOW\t\033[1;33mCOLOR_LIGHT_YELLOW"
- (NSDate*)toISO8601Date{
NSLocale* enUSPOSIXLocale = [[[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"] autorelease];
NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
[dateFormatter setLocale:enUSPOSIXLocale];
NSTimeZone *timeZone = [NSTimeZone timeZoneWithName:@"UTC"];
[dateFormatter setTimeZone:timeZone];
[dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"];
NSDate* createdDate = [dateFormatter dateFromString:self];
return createdDate;
@AidenMontgomery
AidenMontgomery / SendGridMailer.coffee
Created September 15, 2011 17:02
Send an email on Heroku with Node, ExpressJS, emailjs and SendGrid
#START:require
email = require 'emailjs'
#END:require
class SendGridMailer
#START:constructor
constructor: (app) ->
@settings = app.set 'smtpsettings'
#END:constructor