Skip to content

Instantly share code, notes, and snippets.

View m-2k's full-sized avatar
🌴
On vacation

Andy m-2k

🌴
On vacation
View GitHub Profile
@m-2k
m-2k / mou.md
Last active August 29, 2015 14:14 — forked from zhenyi2697/mou.md

Mou

Mou icon

Overview

Mou, the missing Markdown editor for web developers.

Syntax

@m-2k
m-2k / site.conf
Last active August 29, 2015 14:16 — forked from paskal/site.conf
# read more at https://terrty.net/2014/ssl-tls-in-nginx/
# latest version on https://gist.github.com/paskal/628882bee1948ef126dd/126e4d1daeb5244aacbbd847c5247c2e293f6adf
# security test score: https://www.ssllabs.com/ssltest/analyze.html?d=terrty.net
# your nginx version might not have all directives included, test this configuration before using in production against your nginx:
# $ nginx -c /etc/nginx/nginx.conf -t
server {
# public key, contains your public key and class 1 certificate, to create:
# (example for startssl)
# $ (cat example.com.pem & wget -O - https://www.startssl.com/certs/class1/sha2/pem/sub.class1.server.sha2.ca.pem) | tee -a /etc/nginx/ssl/domain.pem > /dev/null
@m-2k
m-2k / observer.md
Last active August 29, 2015 14:16 — forked from pnc/observer.md

Using OTP's observer (appmon replacement) remotely

$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769

Note the running on port for epmd itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:

$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host
@m-2k
m-2k / dist.erl
Last active September 11, 2015 06:57 — forked from 5HT/dist.erl
#!/usr/bin/env escript
-module(dist).
-compile([export_all]).
% optimized combinators
int(true) -> 1;
int(_) -> 0.
rev(L) -> lists:reverse(L).
rtr(L) -> rev(tl(rev(L))).
@m-2k
m-2k / doc.erl
Created September 29, 2015 21:52
-module(doc).
-compile(export_all).
-include_lib("kvs/include/feed.hrl").
-include_lib("nitro/include/nitro.hrl").
-include_lib("n2o/include/wf.hrl").
main() -> #dtl{file="doc",app=review,bindings=[{body,body()}]}.
body() -> [
#h2{body= "Docs search"},
-module(bpg_info).
-author('Andrey Martemyanov').
-compile(export_all).
-record(bpg_info, {
pixel_format,
alpha,
bit_depth,
color_space,
extension_present,
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
======================================================================
Snappy Light
======================================================================
A Sublime Text 2 / Textmate theme.
Copyright (c) 2014 Dayle Rees.
Released under the MIT License <http://opensource.org/licenses/MIT>
======================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
======================================================================
Goldfish
======================================================================
A Sublime Text 2 / Textmate theme.
Copyright (c) 2014 Dayle Rees.
Released under the MIT License <http://opensource.org/licenses/MIT>
======================================================================
@m-2k
m-2k / index.html
Created January 17, 2016 23:53 — forked from campsjos/index.html
Paper.js canvas responsive resizing
<html>
<head>
<style>
#canvas {
width:100%;
}
</style>
</head>
<body>
<canvas id="canvas" width="800" height="600" resize />
@m-2k
m-2k / gist:39084f48340e1ba1be7a
Created February 4, 2016 23:47 — forked from anvaka/gist:3815296
JavaScript Function Serialization
function functionReplacer(key, value) {
if (typeof(value) === 'function') {
return value.toString();
}
return value;
}
function functionReviver(key, value) {
if (key === "") return value;