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
# -*- coding: utf-8 -*- | |
require 'koala' | |
class Safeshare < Padrino::Application | |
register SassInitializer | |
register Padrino::Rendering | |
register Padrino::Mailer | |
register Padrino::Helpers | |
use Rack::Parser |
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
function loadrvm { | |
[ -f ~/.rvm/scripts/rvm ] && { | |
source ~/.rvm/scripts/rvm | |
[ "$RVM_VERSION" ] || export RVM_VERSION='1.9.2' | |
rvm use $RVM_VERSION | |
return | |
} | |
echo "loadrvm: rvm not found" | |
} |
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 'entry' | |
Safeshare.controllers :entries do | |
helpers do | |
def get_entry(id) | |
entry = Entry[id] | |
error 404 unless entry | |
# Facebook acl for this entry |
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
DISTFILE=$(shell realpath ./build)/minimal-linux-home.tgz | |
dist: FORCE | |
rm -f $(DISTFILE) && cd home/ && tar -zcf $(DISTFILE) .* | |
FORCE: | |
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
DISTFILE=$(shell realpath ./build)/minimal-linux-home.tgz | |
dist: FORCE | |
rm -f $(DISTFILE) && cd home/ && tar -zcf $(DISTFILE) .* | |
FORCE: | |
Output: |
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 | |
$str =<<<XML | |
<?xml version="1.0"> | |
<books> | |
<book/> | |
</books> | |
XML; | |
$parts = explode("\n", $str, 2); |
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
"""How to crash syslog.syslog | |
File: crash_syslog.py | |
Running this will product this output: | |
Traceback (most recent call last): | |
File "./crash_syslog.py", line 12, in <module> | |
syslog(LOG_INFO, base64.b64decode(b64)) | |
TypeError: [priority,] message string |
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
# vim: set fileencoding=utf-8 : | |
from __future__ import absolute_import, division | |
from sqlalchemy import ( | |
create_engine, | |
Column, | |
Integer, | |
) | |
from sqlalchemy.orm import sessionmaker | |
from sqlalchemy.ext.declarative import declarative_base |
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
;; add marmalade to ELPA | |
(require 'package) | |
(add-to-list 'package-archives | |
'("marmalade" . "http://marmalade-repo.org/packages/")) | |
(add-to-list 'package-archives | |
'("melpa" . "http://melpa.milkbox.net/packages/")) | |
(package-initialize) | |
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
if (true) { | |
function declaration() { | |
return "first"; | |
} | |
} else { | |
function declaration() { | |
return "second"; | |
} | |
} | |
declaration(); |