Skip to content

Instantly share code, notes, and snippets.

@natcl
natcl / docker-compose.yaml
Created January 2, 2018 15:33
Docker Compose Syslog Example
version: '2'
services:
nodered:
image: nodered/node-red-docker:0.17.5
restart: always
environment:
- TZ=America/Montreal
logging:
driver: syslog
options:
@zulhfreelancer
zulhfreelancer / image-magick.md
Created October 25, 2017 06:07
How to check installed ImageMagick version?
$ convert -version

Version: ImageMagick 7.0.7-8 Q16 x86_64 2017-10-24 http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib
@haircut
haircut / Install PIP to user site on macOS.md
Created August 29, 2017 21:50
How to install and use pip without sudo or admin on macOS

Install and use pip on macOS without sudo / admin access

Most recently tested on macOS Sierra (10.12.6)

  1. Download the installation script; curl https://bootstrap.pypa.io/get-pip.py -o ~/Downloads/get-pip.py
  2. Run the installation, appending the --user flag; python ~/Downloads/get-pip.py --user. pip will be installed to ~/Library/Python/2.7/bin/pip
  3. Make sure ~/Library/Python/2.7/bin is in your $PATH. For bash users, edit the PATH= line in ~/.bashrc to append the local Python path; ie. PATH=$PATH:~/Library/Python/2.7/bin. Apply the changes, source ~/.bashrc.
  4. Use pip! Remember to append --user when installing modules; ie. pip install <package_name> --user

Note

@olih
olih / jq-cheetsheet.md
Last active May 3, 2024 17:42
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@yang-wei
yang-wei / destructuring.md
Last active February 20, 2024 04:40
Elm Destructuring (or Pattern Matching) cheatsheet

Should be work with 0.18

Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !

Tuple

myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))
@qubodup
qubodup / phpbbyoutube
Created April 12, 2015 23:19
simple, secure phpbb embedding NO EXTENSION NEEDED
For this video: http://youtu.be/mxce5nKIe5k
[youtube]{SIMPLETEXT}[/youtube]
<iframe width="560" height="410" src="http://www.youtube.com/embed/{SIMPLETEXT}"></iframe><br />
<a href="http://youtu.be/{SIMPLETEXT}">youtu.be/{SIMPLETEXT}</a>
[youtube]VideoID[/youtube] example: [youtube]mxce5nKIe5k[/youtube]
@evancz
evancz / union-types.md
Last active March 12, 2018 13:14
Imagine conversations and questions for a time when people say "union type" instead of "algebraic data type". Think about how the responses might work if you said "ADT" instead.

Union Types

If Elm community is going to begin referring to "union types" instead of "algebraic data types" we should think about how that will work in practice. What discussions will we have? Will we find ourselves in awkward spots trying to explain things?

The following question/answer pairs simulate things I'd expect to see in a world of "union types". The pairs are grouped by what background I expect the questions to come from so we know the subtext. I have also added some meta comments in italic to explain my phrasing.

One thing to consider is that a lot of learners will not have a person to ask, so the path to arriving at these answers needs to be easy if you are just searching online.

General Questions

@aserafin
aserafin / resque.rake
Created October 10, 2013 10:10
clear all resque tasks from redis
desc "Clear pending tasks"
task "resque:clear" => :environment do
queues = Resque.queues
queues.each do |queue_name|
puts "Clearing #{queue_name}..."
Resque.redis.del "queue:#{queue_name}"
end
puts "Clearing delayed..." # in case of scheduler - doesn't break if no scheduler module is installed
Resque.redis.keys("delayed:*").each do |key|
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@mattd
mattd / gist:1006398
Created June 3, 2011 14:12
nginx try_files with a proxy_pass
server {
root /var/www/example.com/static;
server_name example.com;
access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log;
try_files /maintenance.html @proxy;
location @proxy {
proxy_pass http://127.0.0.1:10001;