Skip to content

Instantly share code, notes, and snippets.

@cweekly
cweekly / how-to-image-magick-icons
Last active May 17, 2021 20:23
CLI ImageMagick (convert, mogrify, etc) create multi-layer favicon.ico from svg
$ brew install imagemagick
# `convert` and `mogrify` provided by imagemagick
$ mogrify --version
Version: ImageMagick 7.0.7-3 Q16 x86_64 2017-09-18 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib
# "mogrify quite useful in converting icons to multilayered ICO format from SVG images.
@cweekly
cweekly / apache-2.4-conf-rewrite-env-vars-example.conf
Last active September 17, 2020 20:19
Example of using mod_rewrite (and mod_setenvif) to manipulate query string parameters, via temp env vars
# Mod_rewrite is great at manipulating HTTP requests.
# Using it to set and read temp env vars is a helpful technique.
#
# This example walks through fixing a query string:
# Extract good query params, discard unwanted ones, reorder good ones, append one new one.
#
# Before: /before?badparam=here&baz=w00t&foo=1&bar=good&mood=bad
# After: /after?foo=1&bar=good&baz=w00t&mood=happy
#
# Storing parts of the request (or anything you want to insert into it) in ENV VARs is convenient.
@cweekly
cweekly / foo.js
Created April 24, 2020 13:07 — forked from vvgomes/foo.js
Ramda vs Lodash
var _ = require("lodash");
var R = require("ramda");
var companies = [
{ name: "tw", since: 1993 },
{ name: "pucrs", since: 1930 },
{ name: "tw br", since: 2009 }
];
var r1 = _(companies).chain()

Keybase proof

I hereby claim:

  • I am cweekly on github.
  • I am cweekly (https://keybase.io/cweekly) on keybase.
  • I have a public key ASC6Gqjhk4OfbXePcnexJyXe8iSMQADplLW8JsBzNrfykwo

To claim this, I am signing this object:

require 'minitest/autorun'
class ProcAndLambdaTest < Minitest::Test
def setup
@arr = [ 1, 2, 3 ]
end
def test_basic_return_behavior
# NOTE: Defining methods like this actually hoists them into the instance. I'm doing this purely
# for organization of the tests.
@cweekly
cweekly / cweekly-bron-yr-hour
Last active December 15, 2015 02:09
Bron-Yr-Hour ;) [music track metadata]
One-take live overlay of me playing on top of Jimmy Page's masterful Bron-Yr-Aur (from Physical Graffiti). Intended as a sincere tribute. I hope I can merely echo or reflect a tiny part of the beauty he created. With all honor and respect to the living legend.
20130317
Roland AC-60
Line6 POD xt live (Scofield patch, no stomp)
Washburn Wi-67pro (neck pickup only, 10+9)
@cweekly
cweekly / cweekly-alive-20121206.txt
Last active October 13, 2015 17:18
Alive [music track metadata]
My 1st post-op electric guitar session. This is what my heart sounded like as it began reacclimating to the land of the living and expecting to stay that way. It was a little strange to play while occasionally openly weeping but it felt good.

I finally captured this 8 minute bit after jamming along these lines for maybe 30-40 minutes. There is way too much "dry" signal in the mix, since I just put my iphone on top of the monitor and hit record w/ the phone mic pointing towards the strings at roughly chest height.
I don't think there's much clipping, but the levels are all off too, which is unsurprising given I used the iPhone Voice Memos.app instead of real music recording equipment.
Technical Notes:
* Guitar: Washburn Wi-67 Pro (mostly neck pickup)
* FX: Line6 PodXT Live (Scofield patch 23C, w/ some use of Amp 32 / class A-30 + Stomp + Delay + some Wah)
* Amp: Roland Acoustic Chorus AC-60 Monitor w/ some reverb
* Recording: iPhone 4s / iOS 5 Voice Memos.app
@cweekly
cweekly / learning-swift-link-list
Last active August 29, 2015 14:19
Learning Swift
@cweekly
cweekly / .gitconfig-partial-p4merge-cmds-2015-02-13
Last active August 29, 2015 14:15
.gitconfig for p4merge (dirs w spaces)
[merge]
keepBackup = false
tool = p4merge
conflictstyle = diff3
[mergetool "p4merge"]
cmd = "'/Applications/p4merge.app/Contents/Resources/launchp4merge'" \
"\"$PWD/$BASE\"" "\"$PWD/$REMOTE\"" "\"$PWD/$LOCAL\"" "\"$PWD/$MERGED\""
keepBackup = false
keepTemporaries = false
trustExitCode = false
@cweekly
cweekly / .zshrc-partial-git-aliases-2015-02-13
Created February 13, 2015 15:45
zshrc aliases for git
alias gba="git branch -avv"
alias gbl="git branch -lvv"
alias gd="git difftool"
alias gdh="git difftool HEAD"
alias gs="git status -s"
alias gst="gs | subl"