Skip to content

Instantly share code, notes, and snippets.

View hal0thane's full-sized avatar
💭
Counting the microseconds until the apocalypse

BH hal0thane

💭
Counting the microseconds until the apocalypse
View GitHub Profile
@hal0thane
hal0thane / gist:141691
Created July 6, 2009 21:26 — forked from defunkt/gist:132456
MAJOR overhaul with per-tty saving and logout autosave
#!/usr/bin/env bash
# Bash snippet to open new shells in most recently visited dir.
# Useful if you want to open a new terminal tab at the present
# tab's location.
# Put this in your .bash_logout ONLY!
# At logout, remember the PWD, and switch there on next login
# TIP: from Allan Odgaard
command1 &> >(command2)
# pipes the output of 'command1' to 'command2' but the status is still evaluated from 'command1'. Really cool.
@hal0thane
hal0thane / gist:156063
Created July 27, 2009 06:12
finding path name parts
<|tatermuffin|.../@-devtools/@-gnu|>
(ttys001|4679)
:> for (( i = 31 ; i > 0 ; i-- )); do
%- if [[ "/" = "/" ]]; then
%- slash=0
%- echo "Final slash at 4: /src"
%- fi
%- done
Final slash at 21: /src/@-devtools/@-gnu
Final slash at 15: /src/@-devtools
@hal0thane
hal0thane / gist:157447
Created July 28, 2009 15:24
FileVault and Launch Services
I've been fighting the same problem and have to say the hint provided here about resetting the launch services, and letting `launchd` do this at login (via Lingon) is invaluable. Thanks a lot for that, it makes FileVault far more usable!
After using this for a while, I have however discovered a side effect of resetting the launch services that is rather annoying--but I have also found a solution for it.
The _problem_ is that after resetting the launch services, calling a protocol handler registered by a user installed application is considered a **first time call** again, meaning it needs to be confirmed by the user (unless the app has been started directly before the call). Examples I stumbled upon are:
* bookmarking through the Pukka bookmarklet
* opening an Evernote note from a Spotlight search
* calling a `man` page in Safari through Bwana.
## RUBY TRICKS TO REMEMBER
# Parallel assignment
x, y = 1, 2 # Parallel assignment: x = 1; y = 2
a, b = b, a # Swap the values of a & b -- no throwaway var needed!
# Using methods to start a code block:
File.open("data.txt") do |f| # Open the file 'data.txt'
@hal0thane
hal0thane / Reload Chrome tabs in front window
Created November 22, 2010 20:55
Fast and easy script to reload all the tabs in your front window in Google Chrome. Change the app name and it works in Chromium.
(*
*
* App: Google Chrome
* Author: Billy H~ ‹-gitster [@] hal0thane net-›
* Updated: 2010-11-22
*
* Rationale:
* I tend to have open many (very many) browser tabs at the same time,
* which is one of the only things that Google Chrome does not seem to
* handle quite well. As a result, Chrome tends to flip out and require me
<!DOCTYPE html>
<html lang="en"xmlns:wb="http://open.weibo.com/wb"><head><meta name="viewport" content="width=1366"><link rel="shortcut icon" type="image/vnd.microsoft.icon" href="https://www.pixiv.net/favicon.ico"><title>Azur Lane, Noshiro (Azur Lane), created by the original author / Milk - pixiv</title><link rel="canonical" href="https://www.pixiv.net/en/artworks/79666245"><link rel="alternate" hreflang="ja" href="https://www.pixiv.net/artworks/79666245"><link rel="alternate" hreflang="en" href="https://www.pixiv.net/en/artworks/79666245"><meta property="twitter:card" content="summary_large_image"><meta property="twitter:site" content="@pixiv"><meta property="twitter:url" content="https://www.pixiv.net/en/artworks/79666245?ref=twitter_photo_card"><meta property="twitter:title" content="Milk"><meta property="twitter:description" content="Milk by ATDAN-"><meta property="twitter:image" content="https://embed.pixiv.net/decorate.php?illust_id=79666245"><meta property="twitter:app:name:iphone" content="pixiv"><m
@hal0thane
hal0thane / 2023q3 Watchlist.html
Created June 21, 2023 05:09
2023q3 Watchlist
<!DOCTYPE html>
<html lang="US">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>Summer 2023 Anime Season Watchlist</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style id="mkstylesheet">
/*
This document has been created with Marked.app <https://marked2app.com>
@hal0thane
hal0thane / 2023q3 Watchlist.md
Last active June 21, 2023 05:11
2023q3 Watchlist

Title: Summer 2023 Anime Season Watchlist Author: kyoudai Date: 2023-06-20

Watchlist

Summer 2023 Anime Season

Last update: 2023-06-20T21:00:23-07:00

| Start | Time Slot[^1] | Title | Status | Type |