Skip to content

Instantly share code, notes, and snippets.

View chew-z's full-sized avatar

Robert J. chew-z

  • Warsaw, Poland
View GitHub Profile
@junegunn
junegunn / b.rb
Last active January 26, 2023 14:34
b - browse Chrome bookmarks with fzf
#!/usr/bin/env bash
# vim: set filetype=ruby:
# b - browse Chrome bookmarks with fzf
[ $(uname) = Darwin ] || exit 1
which fzf > /dev/null 2>&1 || brew reinstall --HEAD fzf || exit 1
/usr/bin/ruby -x "$0" |
fzf-tmux -u 30% --ansi --multi --no-hscroll --tiebreak=begin |
awk 'BEGIN { FS = "\t" } { print $2 }' |
@smileart
smileart / apple_music.js
Created July 4, 2015 15:25
JXA script which automates playlists import to the Apple Music using iTunes
// ======= Motivation ========
// http://www.theverge.com/2015/6/30/8871591/spotify-to-apple-music-migrate
// http://i.giphy.com/1zTqgW6bS2jWU.gif
// https://goo.gl/lMTvOj
// All the delays in this script could be adapted
// for your own needs…
// Add this code to the Script Editor (OS X Only!)
// and press Run… http://i.giphy.com/QfGMSZ25v3pGU.gif
@maglietti
maglietti / HTTPie-blog.md
Last active July 8, 2019 23:57
Exploring Akamai OPEN APIs from the command line using `HTTPie` and `jq`
@lokothodida
lokothodida / getsimple-tutorial-i18n-randomize-results.md
Last active February 7, 2019 12:11
GetSimple tutorial on providing random search results for i18n search.

Ever wanted to have random items put into the search results pulled from I18N Search?

It's actually not that difficult. The technique hinges on the return_i18n_search_results function, specifically designed for doing custom results rendering.

We call the function with the desired paramters to get the results. To ensure a properly random selection, we'll set the maximum number of results to a high number (e.g. 999).

$search = return_i18n_search_results($tags, $words, 0, 999, $order, $lang);
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# addnote.py by JP Mens (September 2015), inspired by Martin Schmitt
# Usage: addnote subject "body (may be empty") [image ...]
# Adds a Notes.app (OSX and iOS) compatible message to the "Notes"
# IMAP folder. The IMAP store is configured from a file called
# `creds':
#
# [imap]
# hostname =
#!/usr/bin/env python
# easyIMAP2Notes (C)2015 by Jan-Piet Mens
# Connect to an IMAP mailbox, read messages, and convert them into
# a format suitable for iOS/OSX Notes, then store them in Notes/
#
# This uses two connections (consider that a feature b/c you can
# slurp from one IMAP account into another). The real reason is I
# couldn't be bothered to implement message decoding/attachment
# extraction with imaplib, so I chose easyimap (pip install easyimap)
# to do that.
@serayuzgur
serayuzgur / Evernote2Notes.scpt
Created October 20, 2015 08:10
Exports from Evernote imports to Apple Notes iCloud Account.
tell application "Evernote"
set _Notebooks to every notebook
repeat with _NoteBook in _Notebooks
set _NoteBookName to name of _NoteBook
set _Notes to every note of _NoteBook
@subfuzion
subfuzion / curl.md
Last active May 12, 2025 12:24
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

local char_to_hex = function(c)
return string.format("%%%02X", string.byte(c))
end
local function urlencode(url)
if url == nil then
return
end
url = url:gsub("\n", "\r\n")
url = url:gsub("([^%w ])", char_to_hex)
@nguyendangminh
nguyendangminh / favicon.ico.go
Last active February 23, 2025 02:33
Serve favicon.ico in Golang
...
func faviconHandler(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "relative/path/to/favicon.ico")
}
...
func main() {
http.HandleFunc("/favicon.ico", faviconHandler)
}