This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://developers.cloudflare.com/images/resizing-with-workers | |
// https://developers.cloudflare.com/workers/examples/cache-api/ | |
addEventListener('fetch', (event) => { | |
if (/image-resizing/.test(event.request.headers.get("via"))) { | |
return fetch(event.request) | |
} | |
event.respondWith(handleRequest(event)) | |
}) | |
async function handleRequest(event) { | |
let request = event.request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Usage: .\sync-meetings.ps1 | |
# | |
$DebugPreference = "Continue" | |
$VerbosePreference = "SilentlyContinue" | |
Add-Type -assembly "Microsoft.Office.Interop.Outlook" | |
$Outlook = New-Object -comobject Outlook.Application | |
$namespace = $Outlook.GetNameSpace("MAPI") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# speed test from command line - https://askubuntu.com/questions/104755/how-to-check-internet-speed-via-terminal | |
curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3 - | |
# vagrant commands | |
vagrant box add ubuntu/bionic64 # to download ubuntu bionic64 images. More can be found at vagrantcloud.com | |
vagrant init bionic64 # to initialize a vm using the image we downloaded | |
vagrant up # to turn on the box that we initialized | |
vagrant ssh # to ssh into the box | |
vagrant reload --provision # to reload after editing Vagrantfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean isOdd(int i) { return (i & 1) != 0; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# mkcd command | |
# This is an improvised version of the mkcd command at http://superuser.com/questions/152794/is-there-a-shortcut-to-mkdir-foo-and-immediately-cd-into-it | |
# This function has to be added to the ~/.bashrc file | |
# After that you can run command like: mkdir abc, mkdir -p one/two/three | |
# | |
function mkcd { | |
last=$(eval "echo \$$#") | |
if [ ! -n "$last" ]; then | |
echo "Enter a directory name" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){window.open('http://www.delicious.com/save?url='+encodeURIComponent(window.location.href)+'&title='+encodeURIComponent(document.title)+'&v=5&jump=doclose');})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby -w | |
# author: rgollapudi | |
# description: Script to fetch all your twitter favorites and write them to a csv file | |
require 'open-uri' | |
require 'rss/1.0' | |
require 'rss/2.0' | |
# For reading rss from a url: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to remove empty png files in a directory | |
find ./ -name "*.png" -size 0 -exec rm {} \; | |
# How to remove all empty files in a directory | |
find ./ -name "*" -size 0 -exec rm {} \; | |
# How to remove all .DS_Store files from a directory in Mac OS X | |
find . -name '*.DS_Store' -type f -delete | |
# How to set 755 permissions on all directories and 646 for all files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby -w | |
require 'rubygems' | |
require 'hpricot' | |
require 'open-uri' | |
require 'spreadsheet' | |
class MetaReader | |
attr_reader :url, :outFile, :links, :book, :sheet1, :rownum | |
attr_accessor :url, :outFile, :links, :book, :sheet1, :rownum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/ruby -w | |
require 'csv' | |
CSV.foreach("contacts.csv") do |row| | |
name = row[0] | |
if name.nil? | |
# do nothing | |
elsif name.empty? | |
# do nothing | |
else | |
command = "google calendar add --cal \"Finelighters Birthdays\" \"#{name}'s Birthday #{row[1]}\"" |
NewerOlder