Skip to content

Instantly share code, notes, and snippets.

View stephenmelrose's full-sized avatar

Steve Melrose stephenmelrose

View GitHub Profile
@stephenmelrose
stephenmelrose / Dockerfile-nginx
Created October 6, 2016 10:12
Docker nginx ENV Example
# ...
# Set default run command
ADD start.sh /opt/start.sh
CMD ["/bin/bash", "/opt/start.sh"]
@stephenmelrose
stephenmelrose / traceroute.log
Last active August 11, 2016 19:55
Connection Issue Trace Route
Traceroute has started…
traceroute to silo-14-66-pub-live-production-us-west-2.amp-aws.public.aol.com (52.10.178.36), 64 hops max, 72 byte packets
1 192.168.1.1 (192.168.1.1) 1.710 ms 2.147 ms 0.757 ms
2 * * *
3 * * *
4 31.55.185.180 (31.55.185.180) 8.660 ms 22.488 ms 9.407 ms
5 core2-hu0-8-0-5.colindale.ukcore.bt.net (195.99.127.154) 11.222 ms 15.333 ms 18.327 ms
6 195.99.127.66 (195.99.127.66) 25.322 ms 20.771 ms 22.453 ms
7 213.137.183.102 (213.137.183.102) 13.811 ms 18.014 ms 13.828 ms
@stephenmelrose
stephenmelrose / form.html
Created July 20, 2016 21:38
Empty POST on IE 9
<form class="login-form" role="form" action="https://DOMAIN/login" method="post">
<input type="hidden" name="_token" value="<TOKEN>">
<fieldset>
<div class="form-group">
<label class="control-label">Email</label>
<input type="email" name="email" class="form-control" required autofocus value="">
</div>
<div class="form-group">
<label class="control-label">Password</label>
@stephenmelrose
stephenmelrose / error.log
Created March 16, 2016 16:54
supervisord Error
2016-03-15 18:57:33,753 INFO stopped: queue-listener-sqs (terminated by SIGTERM)
2016-03-15 18:57:34,409 CRIT Supervisor running as root (no user in config file)
2016-03-15 18:57:34,410 WARN Included extra file "/etc/supervisord/queue-listeners.conf" during parsing
2016-03-15 18:57:34,414 ERRO Web interface error:Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/supervisor-3.2.1-py2.7.egg/supervisor/web.py", line 45, in more
response = self.callback()
File "/usr/local/lib/python2.7/site-packages/supervisor-3.2.1-py2.7.egg/supervisor/web.py", line 162, in __call__
body = self.render()
File "/usr/local/lib/python2.7/site-packages/supervisor-3.2.1-py2.7.egg/supervisor/web.py", line 490, in render
info = rpcinterface.supervisor.getProcessInfo(sent_name)
@stephenmelrose
stephenmelrose / solution.py
Last active November 11, 2015 15:01
Dynamic peewee Expression
'''
Original quesion asked on twitter:
> Anyone out there a bit of a peewee guru? I want to via code add N clauses
> to a "WHERE (A=1 AND B=2) OR (A=1 AND B=2) OR ... etc" type query?
For anyone curious, my solution was as follows,
'''
expressions = None
for cycle in cycles:
@stephenmelrose
stephenmelrose / structure.md
Created September 25, 2015 15:26
Docker folder structure

I generally have Docker related stuff in a subfolder in my repo. In the example below, all the code is sat in the root, but you could equally put all the code in a subfolder as well.

<repo_folder>
    code/
    more_code/
    docker/
        bin/
            setup.sh
 nginx/
@stephenmelrose
stephenmelrose / spec.md
Last active June 22, 2016 14:33
Laptop Spec

Selling a laptop.

  • Defiance Series: 15.6" Matte Full HD IPS LED Widescreen (1920x1080)
  • Intel® Core™ i7 Quad Core Mobile Processor i7-4720HQ (2.60GHz, 3.5GHz Turbo)
  • 16GB KINGSTON SODIMM DDR3 1600MHz (2 x 8GB)
  • NVIDIA® GeForce® GTX 970M - 3.0GB DDR5 Video RAM - DirectX® 11
  • 240GB KINGSTON V300 SSD, SATA 6 Gb (450MB/R, 450MB/W)
  • 120GB KINGSTON V300 SSD, SATA 6 Gb (450MB/R, 450MB/W)
  • Integrated 6 in 1 Card Reader (SD /Mini SD/ SDHC / SDXC / MMC / RSMMC)
  • GIGABIT LAN & WIRELESS INTEL® AC-7260 M.2 (867Mbps, 802.11AC) + BLUETOOTH
@stephenmelrose
stephenmelrose / code.php
Created February 11, 2015 11:53
Lazy Transactions Example
<?php
public function controllerAction($param1, $param2) {
$transactionStarted = false;
try {
$data = $this->modelCall($param1, $param2, $transactionStarted);
if($transactionStarted) {
$this->db->commit();
}
}
@stephenmelrose
stephenmelrose / custom.css
Created October 11, 2014 16:41
Weird CSS class issue experiment
.transaction-categories {
float: right;
}

Keybase proof

I hereby claim:

  • I am stephenmelrose on github.
  • I am stephenmelrose (https://keybase.io/stephenmelrose) on keybase.
  • I have a public key whose fingerprint is 49FD B3CF 15A6 82B6 3794 B154 7BE3 F9ED 82CC 8885

To claim this, I am signing this object: