Skip to content

Instantly share code, notes, and snippets.

Avatar
Coffee

Aaron Moodie aaronmoodie

Coffee
View GitHub Profile
@aaronmoodie
aaronmoodie / email_list_diff.rb
Created Jan 29, 2020
Diff two email lists and find new and missing email
View email_list_diff.rb
# Diff two email lists and find new and missing emails
# To use, call file and pass in an original list and updated list
# eg. ruby email_list_diff.rb ~/original_list.txt ~/updated_list.txt
original_list = File.readlines(ARGV[0])
updated_list = File.readlines(ARGV[1])
def find_unique_emails(list_01, list_02)
# given two email lists, find all emails
# in list_01 that are not in list_02
@aaronmoodie
aaronmoodie / rem_replace.rb
Last active Apr 10, 2018
find rem value and replace with modified version
View rem_replace.rb
# Find and modify all rem values
# To use, call file and pass in CSS dir
# eg. ruby rem_replace.rb ~/my_css_files
dir = ARGV[0]
Dir.glob(dir + '/*.css') do |css_file|
# do work on files ending in .css in the desired directory
puts "working on: #{css_file}..."
View keybase.md

Keybase proof

I hereby claim:

  • I am aaronmoodie on github.
  • I am aaronmoodie (https://keybase.io/aaronmoodie) on keybase.
  • I have a public key whose fingerprint is 483E 8F5F FF31 3295 C283 5C41 5D7A 299A 0864 1366

To claim this, I am signing this object:

View ping duckduckgo.com
➜ ~ ping duckduckgo.com
PING duckduckgo.com (46.51.216.186): 56 data bytes
64 bytes from 46.51.216.186: icmp_seq=0 ttl=47 time=493.049 ms
64 bytes from 46.51.216.186: icmp_seq=1 ttl=47 time=358.478 ms
64 bytes from 46.51.216.186: icmp_seq=2 ttl=47 time=357.297 ms
64 bytes from 46.51.216.186: icmp_seq=3 ttl=47 time=358.935 ms
64 bytes from 46.51.216.186: icmp_seq=4 ttl=47 time=469.308 ms
64 bytes from 46.51.216.186: icmp_seq=5 ttl=47 time=358.160 ms
64 bytes from 46.51.216.186: icmp_seq=6 ttl=47 time=358.421 ms
64 bytes from 46.51.216.186: icmp_seq=7 ttl=47 time=357.605 ms
View gist:39e9f813b6ccb87ee9a5
atom-text-editor::shadow atom-text-editor-minimap {
background: #282C34;
}
View gist:f1f8b2e41507d2a743d9
create_table "product", :force => true do |t|
t.string "name"
t.enum "type" # booklet, tutorial etc
end
create_table "physical_product", :force => true do |t|
t.integer "product_id"
# unique attrs
end
View proto.js
> function Element() {}
undefined
> Element.prototype.render = function() {};
[Function]
> var e = new Element();
undefined
> e.render();
undefined
> e.toString();
'[object Object]'
View pointers.c
int main(int argc, const char * argv[])
{
int x = 0;
int *pointer_to_x = &x; // * is used to do declaration (use & to get the address of x in memory)
*pointer_to_x = 1; // * is a dereference operator
//x is now equal to 1
printf("*pointer_to_x points to the value %i\n", *pointer_to_x);
printf("pointer_to_x is located at the address %p\n\n", pointer_to_x);
View last-modified.html
<script>
var meta_tag = document.createElement('meta');
meta_tag.setAttribute('name', 'last-modified')
meta_tag.setAttribute('content', document.lastModified)
document.getElementsByTagName('head')[0].appendChild(meta_tag)
</script>
View keybase.md

Keybase proof

I hereby claim:

  • I am aaronmoodie on github.
  • I am aaronmoodie (https://keybase.io/aaronmoodie) on keybase.
  • I have a public key whose fingerprint is 09BE 3685 A583 684F 5776 FB2B 88EE 7158 C521 01D2

To claim this, I am signing this object: