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
| #!/bin/bash | |
| qamode="false" | |
| action=$1 | |
| shift | |
| case "$action" in | |
| start|stop) | |
| ;; | |
| *) |
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 'rubygems' | |
| require 'sinatra/base' | |
| class App < Sinatra::Base | |
| get "/" do | |
| redirect "/hello.html" | |
| end | |
| post "/" do |
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
| class LDAPAdapter | |
| def initialize(options={}) | |
| @config = options.select do |key, value| | |
| [:uid].include? key | |
| end | |
| @server = options.select do |key, value| | |
| [:host, :port, :base].include? key | |
| 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
| use lib qw(lib); | |
| use Plack::Builder; | |
| use Mojo::Server::PSGI; | |
| builder { | |
| return sub { | |
| $ENV{MOJO_APP} ||= 'Hello'; | |
| Mojo::Server::PSGI->new->run(@_) | |
| } | |
| } |
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
| #include <iostream> | |
| #include <boost/multi_array.hpp> | |
| using namespace std; | |
| typedef boost::multi_array<double, 2> array2d; | |
| typedef array2d::index index2d; | |
| int main(int argc, char **argv) { | |
| array2d hello(boost::extents[20][25]); |
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/env ruby | |
| require "rubygems" | |
| require "rrd" | |
| file = "rrd/10.31.22.55_queue_com.trendmicro.spn.fbs20.HouseCall_001.03.rrd" | |
| RRD::Wrapper.graph("temp.png", | |
| "DEF:Pending=#{file}:NumMsgs82ff1e7ab6ff:LAST", | |
| "DEF:Enqueue=#{file}:NumMsgsInd604c03a7d:LAST", |
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
| a.out | |
| *.o | |
| *.d |
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
| import org.jsoup.Jsoup; | |
| import org.jsoup.nodes.*; | |
| import org.jsoup.select.*; | |
| public class HelloParser { | |
| public static void main(String[] args) { | |
| try { | |
| Document doc = Jsoup.parse("<html><body><p class=content>內容</p></body></html>"); | |
| Element p = doc.select("p.content").first(); |
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
| #include <iostream> | |
| using namespace std; | |
| class DBClient { // DBClient for production | |
| public: | |
| virtual bool connect() { // should be virtual, this may be the disadvantage. | |
| return true; | |
| } | |
| }; |
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("coffee-script") | |
| square = (x) -> x * x | |
| for i in [1..10] | |
| do (i) -> | |
| console.log(square(i)); | |
| fib = (x) -> |