Skip to content

Instantly share code, notes, and snippets.

View dmix's full-sized avatar

Daniel P. McGrady dmix

View GitHub Profile
@dmix
dmix / cookies.coffee
Created March 28, 2012 02:25
coffeescript to read/write to cookies
App.Functions.readCookie = (name) ->
nameEQ = name + "="
ca = document.cookie.split(";")
i = 0
while i < ca.length
c = ca[i]
c = c.substring(1, c.length) while c.charAt(0) is " "
return c.substring(nameEQ.length, c.length).replace(/"/g, '') if c.indexOf(nameEQ) is 0
i++
ca
@dmix
dmix / aliases.ev
Last active September 24, 2023 15:08
elvish aliases
# ==============================================================================
# Elvish Aliases
# ==============================================================================
# Aliases
# -----------------------------------------------------------------------------
# Git
git-aliases = [
&prefix= "g"
JaoEgEdDPdHaFDjnwQPAqN-4beV71
@dmix
dmix / math.txt
Last active June 8, 2020 02:58
African-Americans deaths by police 2019 vs <55 African-American deaths by COVID-19 in 2020
Results
-----------------------------------------------
African-Americans killed by police 2019:
total = 9
percent of all 48 million african-americans = 0.0000001882845
African-Americans <55 killed by COVID-19 in 2020:
total = 2093
percentage of all 34.4 million <55 african-americans = 0.000060814737331473733147373314737331473733147373314737331
@dmix
dmix / math.md
Created June 8, 2020 02:56
African-Americans deaths by police 2019 vs <55 African-American deaths by COVID-19 in 2020

Results

African-Americans killed by police 2019: total = 9 percent of all 48 million = 0.0000001882845

African-Americans <55 killed by COVID-19 in 2020: total = 2093 percentage of all 34.4 million <55 = 0.000060814737331473733147373314737331473733147373314737331

<template>
<p>{{ hello }}</p>
</template>
<script>
export default {
data() {
return {
hello: 'Hello World!'
}
@dmix
dmix / gist:7abfe3f0f9c4d79f751b
Last active October 28, 2015 21:41
Sort Archlinux AUR packages by votes when querying with Yaourt
yaourt vim > vim.log
cat vim.log | awk '/aur/{print $1 $2 " " $4}' | sed -r 's/\(Out of date\)//g' | sed -r 's/([0-9]*)(\S+)\s\(([0-9]*)\)/\3 - \2/g' | sort -n
OR
yaourt vim | awk '/aur/{print $1 $2 " " $4}' | sed -r 's/\(Out of date\)//g' | sed -r 's/([0-9]*)(\S+)\s\(([0-9]*)\)/\3 - \2/g' | sort -n
[press enter when asked to enter a package number to install]
Host *
PasswordAuthentication no
ChallengeResponseAuthentication no
PubkeyAuthentication yes
HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,ssh-rsa
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
2012-02-16T05:46:19+00:00 heroku[api]: Release v25 created by dan@dmix.ca
2012-02-16T05:46:19+00:00 heroku[api]: Deploy f9a9f12 by dan@dmix.ca
2012-02-16T05:46:20+00:00 heroku[slugc]: Slug compilation finished
2012-02-16T05:47:02+00:00 heroku[web.1]: State changed from created to starting
2012-02-16T05:47:02+00:00 heroku[api]: Scale to web=1 by dan@dmix.ca
2012-02-16T05:47:07+00:00 heroku[web.1]: Starting process with command `lein run`
2012-02-16T05:48:07+00:00 heroku[web.1]: Stopping process with SIGKILL
2012-02-16T05:48:07+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2012-02-16T05:48:08+00:00 heroku[web.1]: Process exited with status 137
2012-02-16T05:48:08+00:00 heroku[web.1]: State changed from starting to crashed
(ns documeds.server
(:require [noir.server :as server]
[clojure.contrib.string :as contrib]))
(server/load-views "src/documeds/views/")
(defn https-url [request-url]
(str "https://" (:server-name request-url) ":" (:server-port request-url) (:uri request-url)))
(defn require-https