Skip to content

Instantly share code, notes, and snippets.

@locofocos
locofocos / readme.md
Created April 14, 2021 17:54
Popout for Google Chrome™ source

There was this great chrome extension called "Popout for Google Chrome™". It gave you a button to open the current page as a popup. This is great for tiling a handful of chrome windows as if they're native applications. Google seems to have removed it from the chrome store, saying "This extension violates the Chrome Web Store policy.".

https://chrome.google.com/webstore/detail/nejkhdlfjifmhomnedomededpaeohcmi

It looks like this is literally all the source code. So I'm leaving this here, in case my current zip backup of the extension ever gets lost, and I (or someone else) wants to recreate this extension.

background.js

chrome.browserAction.onClicked.addListener(function(tab) {
 chrome.windows.create({ tabId : tab.id, type: 'popup' });
@locofocos
locofocos / asdf.rb
Created April 14, 2021 03:36
Sonic PI music
use_bpm 120
live_loop :bass do
4.times do
sample :bd_haus, cutoff: 70, amp: 4
sleep 1
end
end
@locofocos
locofocos / gpm_json_to_csv.rb
Created November 9, 2020 21:22
A ruby script for converting Google Play Music playlists to a Soundizz CSV format for importing to Spotify
# json_file_path is the response body from some REST endpoint that google play music
# used to return the contents of a playlist as you loaded it in the web UI.
# So you need to have saved this before GPM shut down.
#
# output_csv_file_path will contain a CSV file in a format suitable for https://soundiiz.com/
require 'JSON'
require 'byebug'
@locofocos
locofocos / git_untangle.rb
Created November 4, 2020 19:37
Untangles a few git branches into a linear history by rebasing.
# Untangles a few git branches into a linear history by rebasing.
#
# Setup:
#
# In your .gitconfig file, create an alias like so (first line is Windows, 2nd line unix):
#
# [alias]
# untangle = !ruby /c/DEV/git_untangle.rb
# untangle = !ruby ~/git_untangle.rb
#
@locofocos
locofocos / README.md
Last active August 21, 2020 21:59
Jira comment history diff

This is a snippet of JS code that generates a diff on the Jira comment history tab. Currently, Jira generates a nice red/green diff when it sends you an email notification, but it only offers a before/after view of changes on the Jira website itself. Running this JS code will show a similar red/green diff on the Jira website.

Before: image

After: image

Instructions (Chrome):

  • Create a new bookmark. Bookmark anything, even this page, whatever.
@locofocos
locofocos / export instructions.md
Last active July 12, 2020 02:15
Export notes from Samsung Notes to Evernote

Poor man's approach (Windows)

Mostly-batch approach (Windows)

@locofocos
locofocos / changes.java
Created March 23, 2020 02:05
Sweet Home 3D custom PDF page size snippet, the poor man's way
// in PageSetupPanel
public void updateController(PageSetupController controller) {
// ...
Paper paper = this.pageFormat.getPaper();
float width = 45 * 72; // My desired width is 45 inches
float height = 30 * 72; // My desired height is 30 inches
// float theMargin = (float) ((1.0 / 10.0) * 72.0); // 1/10th of an inch
float theMargin = 0; // 0 inches
float paperTopMargin = theMargin;
@locofocos
locofocos / instructions.txt
Created December 1, 2017 05:24
Import Heroku Backup, Local Docker Postgres DB, Windows 10 Home
# OS - Windows 10 Home (which requires Docker Toolbox since it doesn't support Hyper-V)
# Backup was generated from Heroku (which uses pg_dump)
# Backup location: C:\Users\Patrick\Desktop\tmp\latest.dump (change accordingly below)
# Docker image - https://hub.docker.com/_/postgres/
docker run --name some-postgres -v //c/Users/Patrick/Desktop/tmp:/hostfiles/ -e POSTGRES_PASSWORD=password -d postgres
docker exec -it some-postgres pg_restore -U postgres -d postgres -1 /hostfiles/latest.dump
# Error. Copy the role name.