This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// To the extent possible under law, I (Stephan Sokolow) waive all copyright and related or | |
// neighbouring rights to this code snippet. (Though it'd still be nice if you mention me) | |
// If we're running under `php -S` with PHP 5.4.0+ | |
if (php_sapi_name() == 'cli-server') { | |
// Replicate the effects of basic "index.php"-hiding mod_rewrite rules | |
// Tested working under FatFreeFramework 2.0.6 through 2.0.12. | |
$_SERVER['SCRIPT_NAME'] = str_replace(__DIR__, '', __FILE__); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Setup java | |
if [ `uname -m` == 'x86_64' ]; then | |
PATH="/usr/lib64/jvm/java-7-oracle/jre/bin/" | |
JAVA_HOME="/usr/lib64/jvm/java-7-oracle/" | |
else | |
PATH="/usr/lib/jvm/java-7-oracle/jre/bin/" | |
JAVA_HOME="/usr/lib/jvm/java-7-oracle/" | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// like 'Select' editor, but will always return a boolean (true or false) | |
editors.BooleanSelect = editors.Select.extend({ | |
initialize: function(options) { | |
options.schema.options = [ | |
{ val: '1', label: 'Yes' }, | |
{ val: '', label: 'No' } | |
]; | |
editors.Select.prototype.initialize.call(this, options); | |
}, | |
getValue: function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install linux update, followed by GCC and Make | |
sudo yum -y update | |
sudo yum install -y gcc make | |
# Install Nginx and PHP-FPM | |
sudo yum install -y nginx php-fpm | |
# Install PHP extensions | |
sudo yum install -y php-devel php-mysql php-pdo \ | |
php-pear php-mbstring php-cli php-odbc \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
"""Solarized theme for pantheon-terminal | |
see http://ethanschoonover.com/solarized | |
""" | |
import posixpath | |
import sys | |
from gi.repository import Gio |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
$.getScript('//www.youtube.com/iframe_api'); | |
var cnt = 0; | |
$('.flexslider iframe[src*=youtube]').each(function() { | |
$(this).attr('id', 'youtubeplayer' + cnt); | |
cnt++; | |
}); | |
loadSlider(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>Single-Column Responsive Email Template</title> | |
<style> | |
@media only screen and (min-device-width: 541px) { | |
.content { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited | |
# | |
# Current known FCC address ranges: | |
# https://news.ycombinator.com/item?id=7716915 | |
# | |
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft | |
# | |
# In your nginx.conf: | |
location / { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Form.editors.SortableList = Form.editors.List.extend({ | |
initialize: function() { | |
Form.editors.List.prototype.initialize.apply(this, arguments); | |
}, | |
render: function() { | |
Form.editors.List.prototype.render.apply(this, arguments); | |
// sorting | |
if (!this.sortable) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rumoji' | |
def render(data, modifier, modifier_data, message) | |
Rumoji.decode(message) | |
end | |
def weechat_init | |
Weechat.register 'rumoji', 'Pedro Ferreira', '0.0.1', 'MIT', | |
'Render emoki using Rumoji', '', '' |