Skip to content

Instantly share code, notes, and snippets.

@toddsby
toddsby / README.md
Created September 14, 2016 16:30 — forked from Dr-Nikson/README.md
Auth example (react + redux + react-router)
@toddsby
toddsby / nginx
Last active August 29, 2015 14:17 — forked from bastianallgeier/nginx
# block content
location ~ ^/content/(.*).(txt|md|mdown)$ {
rewrite ^/content/(.*).(txt|md|mdown)$ /error redirect;
}
# block all files in the site folder from being accessed directly
location ~ ^/site/(.*)$ {
rewrite ^/site/(.*)$ /error redirect;
}
@toddsby
toddsby / kirby.conf
Last active August 29, 2015 14:17 — forked from ramv/kirby.conf
##############################
## Kirby configuration
##############################
location /kirby/ {
include /etc/nginx/mime.types;
index index.php;
root /var/www/addons88/;
if (!-e $request_filename){
@toddsby
toddsby / github.css
Last active August 29, 2015 14:17 — forked from theconektd/github.css
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
/**
*
* Name v0.0.1
* Description, by Chris Ferdinandi.
* http://gomakethings.com
*
* Free to use under the MIT License.
* http://gomakethings.com/mit/
*
*/
@toddsby
toddsby / forms.twig
Created March 6, 2015 15:10
twig form macros
{% macro input(name, value, type, id, class) %}
<input type="{{ type|default('text') }}" name="{{ name }}" id="{{ id|default(name) }}" value="{{ value|e }}" class="{{ class }}" />
{% endmacro %}
{% macro textarea(name, value, class) %}
<textarea name="{{ name }}" id="{{ id|default(name) }}" class="{{ class }}">{{ value|e }}</textarea>
{% endmacro %}
{% macro label(id, content, class) %}
<label for="{{ id }}" class="{{ class }}">{{ content|e }}</label>
Homebrew server setup
@toddsby
toddsby / patch.txt
Created February 10, 2015 16:02
socket.io and apache reverse proxy fix
I modified the source code of socket.io-client/socket.io.js 1.0.6
line 3387:
return schema + '://' + this.hostname + port + this.path + query;
Changed to:
return schema + '://' + this.hostname + port + this.path + 'ws/' + query;
And my ProxyPass config:
#!/usr/bin/env bash
set -u
set -e
export GIT_WORK_TREE="/var/www/example.com"
export NODE_VERSION="0.10"
echo "--> Checking out..."
git checkout -f
/** @jsx React.DOM */
var STATES = [
'AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI',
'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS',
'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR',
'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY'
]
var Example = React.createClass({