Skip to content

Instantly share code, notes, and snippets.

View tastycode's full-sized avatar

Sasha Devol tastycode

  • Elsewhere Labs
  • New Orleans, LA
View GitHub Profile
@tastycode
tastycode / sync_to_dropbox.sh
Created March 25, 2020 20:04
Sync MacOSX Catalina Voice Memos to Dropbox
echo 'set +e' > /tmp/script.sh && echo 'mkdir -p "$HOME/Dropbox/Voice Memos"' >> /tmp/script.sh && sqlite3 ~/Library/Application\ Support/com.apple.voicememos/Recordings/CloudRecordings.db "select 'cp -n \"' || zpath || '\" \"$HOME/Dropbox/Voice Memos/' || zcustomlabel || '.m4a\"; touch -t '||strftime('%Y%m%d%H%M', datetime(zdate + strftime('%s','2001-01-01'), 'unixepoch'))||' \"$HOME/Dropbox/Voice Memos/' || zcustomlabel || '.m4a\"' from zcloudrecording;" >> /tmp/script.sh; bash -v /tmp/script.sh
@tastycode
tastycode / toggler.max.js
Created December 4, 2021 09:00
Max 4 Live Patches
autowatch = 1
inlets = 1
var toggles = jsarguments[1]
outlets = toggles
var defaultMessage = typeof(jsarguments[2]) == "undefined" ? "hidden" : jsarguments[2]
var lastvalue
/**
This device takes an int, and sends either "hidden 1" or "hidden 0"
to a dynamic number of outlets. Each outlet can be connected to a UI element
@tastycode
tastycode / waves.js
Created December 3, 2021 16:08
Waves plugin sorter
console.log(JSON.stringify([...document.querySelectorAll(".react-list-page__star-rating-total")].map(el => [parseInt(el.innerText.replace(/[^0-9]/g,'')), el.parentNode.parentNode.querySelector(".react-list-page__product-title").innerText]).sort( (a,b) => b[0]-a[0]), null, 4))
body {
font-family: helvetica, sans-serif;
}
@tastycode
tastycode / index.js
Created May 24, 2020 00:25
Find unused recordings in ableton live sets
// usage "node index.js /path/to/your/project.als"
const path = require('path')
const fs = require('fs')
const Ableton = require('ableton') //https://github.com/CocoFox/ableton
const [_,__,projectPath] = process.argv
const project = new Ableton(projectPath)
const main = async () => {
@tastycode
tastycode / cachemark.rake
Created November 23, 2011 16:45
Rails Cache Strategy Benchmarks
require 'benchmark'
task :benchmark => :environment do
stores = {
:file_store=>[Rails.root+"/tmp/cache"],
:mem_cache_store=>["localhost"],
:dalli_store=>["localhost"],
:redis_store=> [],
:mongo_store=> [],
}
let final = ""
for (let el in styles ) {
const tagName = el.charAt(0).toUpperCase() + el.slice(1)
const rules = styles[el]
const transformedRules = Object.keys(rules).map( ruleName => {
const cssRule = ruleName.replace( /([a-z])([A-Z])/g, '$1-$2' ).toLowerCase();
const convertedStyle = ` ${cssRule}: ${rules[ruleName]};`
return convertedStyle
}).join("\n")
const finalComponent = `const ${tagName} = styled(View)\`
@tastycode
tastycode / readme.md
Last active November 4, 2019 22:53
Automating Shipping Through Shyp

Shyp is awesome. They can pick up what you have to ship in minutes and take care of all the packing and addressing. Their rates are as cheap as you can get and they have a custom boxing process that minimizes void space.

This would be great for shipping things in bulk if it weren't for them not having an API, or any other means to enter shipments other than their iPhone app.

I had 100 shipments to make, so I threw together this script to automate the creation of the shipments. This isn't for the faint of heart, you'll have to know how to create a transparent HTTPS proxy and hook your iPhone up to it so you can get your session and authorization headers. I'm not going to go into that, but once you get the appropriate headers, put them in a file called shyp.headers. You'll also need to create a shipment manually through the app in order to get a PICKUP_ID. Once you have that, just add your addresses to the array called addresses and run the script. I also didn't want to figure out

[ [ { title: 'A Camp with No Name (ACWNN)',
description: 'The dead horse is scarce, and we continue to beat it. Come by and sit in the desert in A Camp With No Name, where you will be told that buttered popcorn is a perfectly fantastic snow cone flavor – why would you think otherwise? (Don’t worry – there are “normal” flavors.) Look for us carting around chai or tidying up the playa with our vacuum cleaner.',
Hometown: 'Denver',
URL: 'https://www.facebook.com/pages/A-Camp-with-No-Name/259880375086?ref=hl' },
{ title: 'A Cosmic Carnivale',
description: 'Come and visit a Cosmic Carnival and may your body never miss a beat to the rhythm of this world.',
Hometown: 'Reno',
Contact: 'cosmiccarnivale@gmail.com' },
{ title: 'A Shack of Sit',
description: 'SIT HAPPENS HERE 24×7. Shady chairs & lounges: refresh, rest, meet Burners. Enjoy iced water, healthy snax, lots of activities & WiFi.',
@tastycode
tastycode / autoActionLazyProxy.js
Last active April 20, 2018 18:04
Auto generated action creators
// types.js
const REPORTER_PENDING_REPORT_UPDATE = "[reporter] pending report update"
// actions/reporter.js
const simpleActionCreatorProxy = new Proxy(module.exports, {
get (target, key) {
const actionName = camelToUnderscore(key).toUpperCase()
if (key in target) {
return target[key]