Skip to content

Instantly share code, notes, and snippets.

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 ( on keybase.
  • I have a public key ASC6Gqjhk4OfbXePcnexJyXe8iSMQADplLW8JsBzNrfykwo

To claim this, I am signing this object:

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
Copyright: © 1999-2017 ImageMagick Studio LLC
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.
require 'minitest/autorun'
class ProcAndLambdaTest < Minitest::Test
def setup
@arr = [ 1, 2, 3 ]
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 / learning-swift-link-list
Last active August 29, 2015 14:19
Learning Swift
cweekly / .gitconfig-partial-p4merge-cmds-2015-02-13
Last active August 29, 2015 14:15
.gitconfig for p4merge (dirs w spaces)
keepBackup = false
tool = p4merge
conflictstyle = diff3
[mergetool "p4merge"]
cmd = "'/Applications/'" \
"\"$PWD/$BASE\"" "\"$PWD/$REMOTE\"" "\"$PWD/$LOCAL\"" "\"$PWD/$MERGED\""
keepBackup = false
keepTemporaries = false
trustExitCode = false
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"
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.
brew update
brew versions FORMULA
cd `brew --prefix`
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions"
brew install FORMULA
git checkout -- Library/Formula/FORMULA.rb # reset formula
## Example: Switch to git 1.9.0 in particular: