I hereby claim:
- I am proprietary on github.
- I am zelly (https://keybase.io/zelly) on keybase.
- I have a public key ASD9bCbFInpbh5w-KGEFJ2s9a4S1_qlYRtiGZOpv5H2KWAo
To claim this, I am signing this object:
(function() { | |
var urlHostname = function(url) { | |
var a = document.createElement('a') | |
a.href = url | |
return a.hostname | |
} | |
var reProtocol = /https?/, l = document.links | |
for (var idx = 0; idx < l.length; ++idx) { | |
if (urlHostname(l[idx].href) !== window.location.hostname && reProtocol.test(l[idx].href)) { | |
l[idx].setAttribute('target', '_blank') |
import ( | |
"database/sql" | |
_ "github.com/lib/pq" | |
"log" | |
) | |
// queryMap is used for quickly running a SQL query that returns only one | |
// row. Important: This shouldn't ever return errors and shouldn't ever | |
// be applied on user input. Ideally, you're querying non-nullable | |
// columns using keys you got from some trusted (non-human) |
https://www.google.com/search?source=hp&q=%s&oq=%s&btnI=1 |
function roundTiesToEven(n) { | |
var TOLERANCE = 1e-6 | |
if (Math.abs(n%1 - 0.5) <= TOLERANCE) { | |
var f = Math.floor(n) | |
return f%2 === 0 ? f : f+1 | |
} else { | |
return Math.round(n) | |
} | |
} |
#!/usr/bin/env bash | |
# Deletes currently playing song in Clementine (works on GNU/Linux). Helps thin out a music library. | |
# 1. chmod a+x rmcl | |
# 2. add to PATH | |
# 3. use in GNOME by Alt+F2 + 'rmcl', easy | |
function is_playing() { | |
qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player PlaybackStatus | |
} |
# Change the relevant {{ PARTS OF THIS FILE }} for your remote address etc. | |
# Make sure this unit file is named similarly to your mountpoint; e.g., for /mnt/mymountpoint name this file mnt-mymountpoint.mount | |
# On Ubuntu: | |
# $ sudo cp mnt-mymountpoint.mount /lib/systemd/system/ | |
# $ sudo systemctl enable mnt-mymountpoint.mount | |
# $ sudo systemctl start mnt-mymountpoint.mount | |
# On Fedora: | |
# $ sudo cp mnt-mymountpoint.mount /etc/systemd/system | |
# $ sudo systemctl enable mnt-mymountpoint.mount | |
# $ sudo systemctl start mnt-mymountpoint.mount |
require 'net/smtp' | |
def send_email (to:, msg:, subject:, from_name:, from:, password:) | |
message = "From: #{from_name} <#{from}>\n" \ | |
"To: <#{to}>\n"\ | |
"Subject: #{subject}\n"\ | |
"#{msg}\n" | |
smtp = Net::SMTP.new 'smtp.gmail.com', 587 | |
smtp.enable_starttls | |
smtp.start('gmail.com', |
First, run the following command to create a blank disk image: | |
$ hdiutil create -o /tmp/HighSierra.cdr -size 7316m -layout SPUD -fs HFS+J | |
Next, mount your blank image: | |
$ hdiutil attach /tmp/HighSierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build | |
Now you’re going to restore BaseSystem.dmg from the installer over to the newly mounted image: |
#include <windows.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
BOOL parseDword(const char* in, DWORD* out) | |
{ | |
char* end; | |
long result = strtol(in, &end, 10); | |
BOOL success = (errno == 0 && end != in); | |
if (success) |
I hereby claim:
To claim this, I am signing this object: