Skip to content

Instantly share code, notes, and snippets.

View thealanberman's full-sized avatar
🍸
learning

Alan Berman thealanberman

🍸
learning
  • SF Bay Area
View GitHub Profile
@danharper
danharper / background.js
Last active August 23, 2024 01:26
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@boneskull
boneskull / hook-line-and-syncer
Last active August 20, 2019 18:24
rsync stuff to a different directory on file changes (Mac OS X)
#!/bin/bash
# Get fswatch: brew install fswatch
EXCLUDES_FILE="/tmp/syncer-excludes.txt"
SOURCES=( "/path/to/folder/to/watch" )
EXCLUDES=(
"*.vmwarevm"
".DS_Store"
"Icon\r"
".dropbox"
@stevebowman
stevebowman / AWSLambdaSimpleSMS.js
Last active June 22, 2023 12:09
AWS Lambda Function to send an SMS message via the Twilio API
console.log('Loading event');
// Twilio Credentials
var accountSid = '';
var authToken = '';
var fromNumber = '';
var https = require('https');
var queryString = require('querystring');
security find-certificate -c "Izenpe.com" -a -Z "/System/Library/Keychains/SystemRootCertificates.keychain"| grep SHA-1 | awk '{print $NF}'
sudo security delete-certificate -Z 30779E9315022E94856A3FF8BCF815B082F9AEFD -t "/System/Library/Keychains/SystemRootCertificates.keychain"
security find-certificate -c "certificatename" -a -Z | \
sudo awk '/SHA-1/{system("security delete-certificate -Z "$NF)}'
@sj26
sj26 / LICENSE.md
Last active November 6, 2024 21:56
Bash retry function

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit

@smithclay
smithclay / index.js
Created June 16, 2017 18:30
"Hello World" AWS Lambda + Terraform Example
// 'Hello World' nodejs6.10 runtime AWS Lambda function
exports.handler = (event, context, callback) => {
console.log('Hello, logs!');
callback(null, 'great success');
}