Skip to content

Instantly share code, notes, and snippets.

View rsiddle's full-sized avatar

Ryan Siddle rsiddle

View GitHub Profile
(ns webscraper.core
(:gen-class)
(:require [clojure.core.async :as async]))
(defn process [line]
line)
(def stdin-reader
(java.io.BufferedReader. *in*))
@rsiddle
rsiddle / nginx.overrides
Created February 19, 2016 08:50 — forked from sheharyarn/nginx.overrides
Restart / Reload Nginx without Entering Sudo Password
# Enter this command to create a sudoers override/include file:
# sudo visudo -f /etc/sudoers.d/nginx.overrides
# (Make sure you actually have this in your /etc/sudoers - Run `sudo visudo` to check)
# #includedir /etc/sudoers.d
# This file assumes your deployment user is `deploy`
# Nginx Commands
Cmnd_Alias NGINX_RESTART = /usr/sbin/service nginx restart
=> [1.087615, 1.097275, 1.104355, 1.09975, 1.102865, 1.105785, 1.10349, 1.12182, 1.11933, 1.117675, 1.116665, 1.112515, 1.12425, 1.13424]
[7] pry(OandaGateway)> b
=> [1.082565, 1.08538, 1.09036, 1.09841, 1.094005, 1.09675, 1.09461, 1.08223, 1.108065, 1.11359, 1.10778, 1.1072, 1.105775, 1.121635]
[8] pry(OandaGateway)> b-a
=> [1.082565, 1.08538, 1.09036, 1.09841, 1.094005, 1.09675, 1.09461, 1.08223, 1.108065, 1.11359, 1.10778, 1.1072, 1.105775, 1.121635]
Here's £115 of free cab rides. There's a new challenger to Uber called Karhoo. Karhoo released many promo codes that can all be used in conjunction, adding up to £115 of account credit. They are:
JULY1 - £20
KAR15 - £15
RYANS567 - £10
KAR20 - £20
BONUS10 - £10
BONUS20 - £20 (US Only)
SUMMER16 - £10
MAN10 - £10
@rsiddle
rsiddle / sitemap.rb
Created October 24, 2016 15:54
Ecommerce Solidus SEO - XML Sitemap Generation
# Copyright (c) 2016, Ryan Siddle. Part of the http://merj.com/digital/solidus-seo
# All rights reserved.
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIM
@rsiddle
rsiddle / sitemap.rb
Created October 24, 2016 16:04
Spree SEO - XML Sitemap Generation
# Copyright (c) 2016, Ryan Siddle. Part of the http://merj.com/digital/spree-seo
# All rights reserved.
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED
Ryans-MBP:able ryan$ ./test
Mar 6 12:57:51 test[1938] <Warning>: void CGSUpdateManager::log() const: conn 0x3f4df token 0x1ffffffffffe85
Mar 6 12:57:51 test[1938] <Warning>: Backtrace (at 72737.8):
Mar 6 12:57:51 test[1938] <Warning>: void CGSUpdateManager::log() const: 0 CoreGraphics 0x00007fff85a385ac CGSDisableUpdateToken + 155
Mar 6 12:57:51 test[1938] <Warning>: void CGSUpdateManager::log() const: 1 AppKit 0x00007fff98679420 ___disable_updates_sync_block_invoke_2 + 17
Mar 6 12:57:51 test[1938] <Warning>: void CGSUpdateManager::log() const: 2 libdispatch.dylib 0x00007fff8d05b40b _dispatch_client_callout + 8
Mar 6 12:57:51 test[1938] <Warning>: void CGSUpdateManager::log() const: 3 libdispatch.dylib 0x00007fff8d05c9f2 _dispatch_barrier_sync_f_invoke + 74
Mar 6 12:57:51 test[1938] <Warning>: void CGSUpdateManager::log() const: 4 AppKit 0x00007fff986792ee NSCGSDis
@rsiddle
rsiddle / d-2.rb
Last active June 9, 2017 12:43
d-2.rb
def d(a, b, &block)
va = a.is_a?(Array) ? 1 : 0
vb = b.is_a?(Array) ? 2 : 0
v = va + vb
case v
when 0
block.call(a, b)
when 1
a.map do |e|
d(e, b, &block)
@rsiddle
rsiddle / x-dns-prefetch-control-on.html
Created September 19, 2017 14:30
Showing how to switch on DNS-prefetch for Chrome and Firefox through a <meta> tag
<head>
<meta http-equiv="X-DNS-Prefetch-Control" content="on" />
<link rel="dns-prefetch" href="https://fonts.googleapis.com" />
<link rel="dns-prefetch" href="https://ajax.googleapis.com" />
<link rel="dns-prefetch" href="https://cdnjs.cloudflare.com" />
<link rel="dns-prefetch" href="https://www.google-analytics.com" />
</head>
@rsiddle
rsiddle / multi-switch-x-dns-prefetch-control.html
Created September 19, 2017 14:35
Showing how to switch on and off DNS-prefetch for Chrome and Firefox through multiple <meta> tags
<!DOCTYPE html>
<html lang="en">
<head>
...
<meta http-equiv="X-DNS-Prefetch-Control" content="on" />
<link rel="dns-prefetch" href="https://fonts.googleapis.com" />
<link rel="dns-prefetch" href="https://ajax.googleapis.com" />
<link rel="dns-prefetch" href="https://cdnjs.cloudflare.com" />
<link rel="dns-prefetch" href="https://www.google-analytics.com" />
...