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
| package main | |
| import ( | |
| "log" | |
| "net/http" | |
| "time" | |
| ) | |
| func main() { | |
| mux := http.NewServeMux() |
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 find($id) | |
| { | |
| $query = $this->db->where($this->primary_key, $id) | |
| ->get($this->table); | |
| if ($query->num_rows() == 1) | |
| { | |
| return $query->row(); | |
| } | |
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
| protected $authentication = 'none'; // Can be 'none', 'basic' or 'digest' | |
| protected $username = FALSE; | |
| protected $password = FALSE; | |
| protected $key = FALSE; | |
| protected $format = 'html'; | |
| protected $supported_formats = array( | |
| 'html' => 'text/html', | |
| 'php' => 'text/plain', |
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 define('BASEPATH', TRUE); include('libraries/snippt.php'); | |
| class example extends snippt | |
| { | |
| function index() | |
| { | |
| $data = array( | |
| 'message' => 'Hello world!', | |
| 'time' => date('D, jS F y - h:i a') | |
| ); |
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
| /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| Simple Password - Returns a simple pronouncable passphrase. | |
| Examples: Motir27, Wesag97, Muvak41 | |
| Rated as 'good' by http://www.passwordmeter.com/ | |
| @access public | |
| @return string | |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ | |
| function simple_password() { |
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 | |
| //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| // VARIOUS FIND FUNCTIONS | |
| //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| function find($id) | |
| { | |
| $query = $this->db->where($this->primary_key, $id) | |
| ->get($this->table); |
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 ARGV.include?('--help') | |
| File.read(__FILE__).split("\n").grep(/^# /).each do |line| | |
| puts line[2..-1] | |
| end | |
| exit 0 | |
| end | |
| require 'rdiscount' | |
| STDOUT.write(RDiscount.new(ARGF.read).to_html) |
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 'sinatra' | |
| before do | |
| response['Cache-Control'] = 'no-cache, no-store' if request.xhr? | |
| end | |
| get '/' do | |
| erb :home, layout: ! request.xhr? | |
| end |
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 'sinatra' | |
| before do | |
| response['Cache-Control'] = 'no-cache, no-store' if request.xhr? | |
| end | |
| get '/' do | |
| erb :home, layout: ! request.xhr? | |
| end |
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 'sinatra' | |
| before do | |
| response['Cache-Control'] = 'no-cache, no-store' if request.xhr? | |
| end | |
| get '/' do | |
| erb :home, layout: ! request.xhr? | |
| end |
OlderNewer