Skip to content

Instantly share code, notes, and snippets.

View cam8001's full-sized avatar
💭
lol no

Cameron Tod cam8001

💭
lol no
  • Amazon Web Services
  • Wellington, New Zealand
  • 03:47 (UTC +12:00)
View GitHub Profile
@eyecatchup
eyecatchup / git-commit-log-stats.md
Last active May 22, 2024 12:19
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




@philipstanislaus
philipstanislaus / sane-caching.nginx.conf
Last active April 11, 2024 03:35
Sample Nginx config with sane caching settings for modern web development
# Sample Nginx config with sane caching settings for modern web development
#
# Motivation:
# Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools.
# These tools automatically deactivate all sorts of caching for you, so you always have a fresh
# and juicy version of your assets available.
# At some point, however, you want to show your work to testers, your boss or your client.
# After you implemented and deployed their feedback, they reload the testing page – and report
# the exact same issues as before! What happened? Of course, they did not have developer tools
# open, and of course, they did not empty their caches before navigating to your site.
@leonardofed
leonardofed / README.md
Last active June 10, 2024 15:36
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@cam8001
cam8001 / remove_bt.sh
Created October 20, 2016 21:01
Remove BT from saved networks in macOS
#!/bin/sh
for i in `networksetup -listpreferredwirelessnetworks en0 | grep BT`; networksetup -removepreferredwirelessnetwork en0 $i;
@scokmen
scokmen / HttpStatusCode.ts
Created April 25, 2017 11:10
Typescript Http Status Codes Enum
"use strict";
/**
* Hypertext Transfer Protocol (HTTP) response status codes.
* @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes}
*/
enum HttpStatusCode {
/**
* The server has received the request headers and the client should proceed to send the request body
@M165437
M165437 / ScheduleList.php
Last active November 27, 2022 12:20
PHP Artisan command that lists all scheduled tasks: php artisan schedule:list (Credit: https://stackoverflow.com/a/35559970/2714126)
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Console\Scheduling\Schedule;
class ScheduleList extends Command
{
/**
@cam8001
cam8001 / show_passwords.js
Created January 8, 2018 03:15
Convert password fields to plain text
// Readable version
inputs = document.getElementsByTagName('input');
for (i = 0; i < inputs.length; i++) {
if (inputs[i].type == 'password') {
inputs[i].type = 'text'
}
}
// Bookmarklet version
javascript:(function()%7Binputs%20%3D%20document.getElementsByTagName('input')%3Bfor%20(i%3D0%3B%20i%20%3C%20inputs.length%3B%20i%2B%2B)%20%7B%20if%20(inputs%5Bi%5D.type%20%3D%3D%20'password')%20%7Binputs%5Bi%5D.type%20%3D%20'text'%7D%7D%7D)()
@palmerj
palmerj / gist:e293b443def642431f05775aa4d7f640
Last active July 25, 2022 15:45
One liner to get AWS S3 IP address ranges for ap-southeast-2 (Sydney)
curl https://ip-ranges.amazonaws.com/ip-ranges.json | jq '.prefixes' | jq 'map(select(.region=="ap-southeast-2"))' | jq 'map(select(.service=="S3"))' | jq 'map(.ip_prefix)'
@jflasher
jflasher / details.md
Created February 23, 2018 14:56
Accessing data older than 90 days from OpenAQ

Currently, only data within the last 90 days is available via the OpenAQ API. However, there is much more data available on OpenAQ and a variety of different access mechanisms. Note also that there is work under way to bring back to the API a mechanism to access the data older than 90 days, details here.

If you're looking to query across all the data or even easily export the data (or a subset of it), the easiest way to do that currently is using a service like Amazon Athena. I'll provide some directions on how to do that below, but at a high level, this will let you make any query of the entire dataset that you'd like (written in SQL). I'll also provide some sample queries so you can see what's possible.

On to the directions!

  1. You will need to create an AWS account if you don't currently have one, you can start this process at htt
@ConnerAiken
ConnerAiken / robbyrussell.zsh-theme
Created March 20, 2018 16:34
ZShell - Robby Russell Theme /w User@Host in prompt
GNU nano 2.5.3 File: /home/connera/.oh-my-zsh/themes/robbyrussell.zsh-theme Modified
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
# Customize and add user/host perfix
PROMPT="%{$fg[white]%}%n@%{$fg[green]%}%m%{$reset_color%} ${PROMPT}"
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"