Skip to content

Instantly share code, notes, and snippets.

View ajchemist's full-sized avatar
🕶️

ajchemist

🕶️
  • Korean Peninsula
View GitHub Profile
#!/bin/bash
# Installs the XCode command line tools if you don't have them
xcode-select --install
# Installs brew if you don't have it
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Makes your account the owner of /usr/local, which is preferred on single user Macs
sudo chown -R `whoami` /usr/local
# Installs all the dependencies for building libtorrent and rtorrent
brew install automake libtool boost curl lzlib libsigc++ openssl
# Uninstall libtorrent-rasterbar if you already have it
@ajchemist
ajchemist / PowerShell Customization.md
Created February 6, 2018 05:58 — forked from jchandra74/PowerShell Customization.md
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

@ajchemist
ajchemist / README.md
Created January 5, 2018 06:11 — forked from ahmadsoe/README.md
VPNGate Python script

#VPNGate for OS X This script is a simple script for using to connect vpn server list provided VPNGate through OpenVPN on OS X environment.

It inspired by VPNGate Python script wrtten by Andrea Lazzarotto.

##Requirements If you use the script, Tunnelblick needs to be installed first.

##Installation Open terminal app and copy & paste the command below.

@ajchemist
ajchemist / gist:525a167fc990ae9f9cf9d621fbb75940
Created April 2, 2017 13:23 — forked from rmondello/gist:b933231b1fcc83a7db0b
Exporting (iCloud) Keychain and Safari credentials to a CSV file

Exporting (iCloud) Keychain and Safari credentials to a CSV file

After my dad died, I wanted to be able to have access any of his online accounts going forward. My dad was a Safari user and used iCloud Keychain to sync his credentials across his devices. I don’t want to have to keep an OS X user account around just to access his accounts, so I wanted to export his credentials to a portable file.

This is the process I used to create a CSV file of his credentials in the format “example.com,user,pass”. This portable format would be pretty easy to import into 1Password or Safari in the future.

The way I went about this isn’t great; it opens up more opportunities for apps to control one’s Mac through Accessibility APIs, it writes plaintext passwords to disk, and it could use some cleaning up. A better approach might leverage the security command line tool that ships with OS X. That said, I found this method to be a fun illustration of what’s possible us

(ns interface.a)
(defprotocol X
(x [this]))
(ns interface.b)
(defprotocol X
(x [this]))
upstream registry
{
server 172.20.0.41:5000 fail_timeout=9s max_fails=1;
}
map $upstream_http_docker_distribution_api_version $docker_distribution_api_version
{
'' 'registry/2.0';
}
createFromNow createFromMillis createFromYYMMDD createFromHHMMSS plusDays plusSeconds parse format
Java 8 LocalDate 6,887,052 – 57,485,029 – 21,407,624 – 1,908,396 3,345,600
Java 8 LocalDateTime 6,476,683 10,729,613 33,168,805 27,359,088 19,010,416 23,778,071 604,047 1,122,586
Java 8 LocalTime 8,298,755 – – 42,708,848 – 35,294,117 998,302 1,437,194
Java 8 OffsetDateTime 5,263,157 10,214,504 26,698,450 27,648,000 16,493,447 17,069,701 86,935 1,035,196
Java 8 OffsetTime 6,207,324 14,858,841 – 38,348,868 – 27,149,321 125,505 1,467,566
Java 8 ZonedDateTime 5,646,527 9,615,384 8,383,233 8,275,862 9,530,026 10,449,927 70,891 1,078,167
Java GregorianCalendar 4,288,164 2,571,355 3,502,371 3,578,380 6,937,844 8,670,520 481,741 1,730,702
Joda DateTime 21,276,595 34,013,605 10,020,876 10,502,005 12,547,267 29,149,797 896,619 2,088,991
Joda MutableDateTime 20,618,556 31,847,133 10,014,903 10,658,771 13,685,789 41,618,497 893,176 2,080,299
/*******************************************************************************
* *
* ScrollBar *
* *
******************************************************************************/
.scroll-bar{
-fx-background-color: white;
}
.scroll-bar:horizontal .track,
.scroll-bar:vertical .track {
@ajchemist
ajchemist / journal-toc.el
Created November 6, 2016 13:42
org-journal-toc
;;;; journal.el starts here
(require 'org)
(require 'org-journal "fstorm-org/org-journal")
;;;###autoload
(defun org-journal--toc ()
(interactive)
(let ((bufname "*Org journal toc*"))
(with-current-buffer-window
#!/bin/bash
form=$(echo \
\(progn \
\( setenv \"TMPDIR\" \"$TMPDIR\" \) \
"(require 'server)" \
"(message server-socket-dir)" \))
emacs --batch --eval "$form" 2>&1