Skip to content

Instantly share code, notes, and snippets.

Avatar

Cameron Kalegi ckalegi

View GitHub Profile
View lds-player-controls.js
/* LDS Player Controls
* @ckalegi
*
* Preview tracks quicker by seeking through and marking for download with keyboard commands
*
* USE:
* Open folder containing tracks
* Up/Down arrows - previous/next song
* Left/Right arrows - Seek forward/back 10 seconds
* Space - Play/pause
@ckalegi
ckalegi / Code.gs
Last active Apr 15, 2020
Bare-bones dynamic, mass email via gmail
View Code.gs
/**
* Sends emails with data from the current spreadsheet.
*
* sheet column names:
* A B C D
* email first_name url subject
*/
function sendEmails() {
var sheet = SpreadsheetApp.getActiveSheet();
View exportGcalEvents.gs
// Export gCal events to gSheet
//
// Saves cal events between 2 dates to a sheet
// Calculates event duration by hour as a float (1hr 30m = 1.5)
// ** Open a google sheet > Tools > Script Editor > Paste this > Enter your own params > Save > Run
function exportGcal(){
// PARAMS
// ------
// myEmail : string
@ckalegi
ckalegi / antiAntiDebugger.js
Created Oct 19, 2018
Prevent obfuscated client side scripts from calling anonymous debugger functions
View antiAntiDebugger.js
window.unsafeWindow || (
unsafeWindow = (function () {
var el = document.createElement('p');
el.setAttribute('onclick', 'return window;');
return el.onclick();
}())
);
(function () {
var _constructor = unsafeWindow.Function.prototype.constructor;
@ckalegi
ckalegi / gmailCalInvite-autoArchive.js
Created Oct 10, 2018
Auto-archive past Gcal Invitations - for use in google apps scripts
View gmailCalInvite-autoArchive.js
function findInvites(e) {
console.log('Starting Calendar Archive');
// Find all calendar invitations
var threads = GmailApp.search("has:attachment .ics in:inbox");
console.log('Found ' + threads.length + ' calendar invitations');
for (var threadCounter = 0; threadCounter < threads.length; threadCounter++) {
var messages = threads[threadCounter].getMessages();
// iterate through each invit
@ckalegi
ckalegi / spamiMessage.applescript
Last active Jul 2, 2018
Send the same iMessage N times to X recipient
View spamiMessage.applescript
on run
set promptTargetPhone to display dialog "Enter the iMessage phone number or email of target recipient" default answer ""
set targetPhone to text returned of promptTargetPhone
set promptTargetMessage to display dialog "Enter the message to send" default answer ""
set targetMessage to text returned of promptTargetMessage
set promptSendCount to display dialog "How many times should it send?" default answer ""
set sendCount to text returned of promptSendCount
repeat sendCount times
tell application "Messages"
set targetService to 1st service whose service type = iMessage
@ckalegi
ckalegi / IP + Location from command line
Last active Jun 22, 2018
IP + Location from terminal
View IP + Location from command line
save myip.py to ~/
add .bash_profile to ~/.bash_profile
View bountyscan_setup.sh
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive;
echo "[*] Starting Install... [*]"
echo "[*] Upgrade installed packages to latest [*]"
echo -e "\nRunning a package upgrade...\n"
apt-get -qq update && apt-get -qq dist-upgrade -y
apt full-upgrade -y
apt-get autoclean
echo "[*] Install stuff I use all the time [*]"
@ckalegi
ckalegi / zips.json
Created Jun 16, 2017
Zipcodes with lat/lng by State and City
View zips.json
This file has been truncated, but you can view the full file.
[
{"zip": "35004", "state": "AL", "latitude": " 33.606379", "longitude": " -86.50249", "city": "Moody", "fullState": "Alabama"},
{"zip": "35005", "state": "AL", "latitude": " 33.592585", "longitude": " -86.95969", "city": "Adamsville", "fullState": "Alabama"},
{"zip": "35006", "state": "AL", "latitude": " 33.451714", "longitude": " -87.23957", "city": "Adger", "fullState": "Alabama"},
{"zip": "35007", "state": "AL", "latitude": " 33.232422", "longitude": " -86.80871", "city": "Alabaster", "fullState": "Alabama"},
{"zip": "35010", "state": "AL", "latitude": " 32.903432", "longitude": " -85.92669", "city": "Alexander City", "fullState": "Alabama"},
{"zip": "35014", "state": "AL", "latitude": " 33.355960", "longitude": " -86.27720", "city": "Alpine", "fullState": "Alabama"},
{"zip": "35016", "state": "AL", "latitude": " 34.323715", "longitude": " -86.49278", "city": "Arab", "fullState": "Alabama"},