This file contains 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 that checks whether the command line input is valid. This | |
* method can handle input with spaces that are escaped inside | |
* quotation marks (either " or '). However this method will throw | |
* an Exception when either the input is empty or when the input | |
* is malformed. | |
* | |
* Malformed input occurs when there are an odd number of quotation | |
* marks in the input string, but only if there are more than one. | |
* |
This file contains 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 ( | |
"github.com/bmizerany/pat" | |
"log" | |
"net/http" | |
"os" | |
) | |
func main() { |
This file contains 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
JSON.Join = function(jsons) { | |
var retJson = {}; | |
for (var j1 in jsons) { for (var j2 in jsons[j1]) { retJson[j2] = jsons[j1][j2]; } } | |
return retJson; | |
}; |
This file contains 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
// Streaming function for Javascript, wrapped as a jQuery function. | |
// @param url URL of the receive. | |
// @param callback Callback function on when data is received. When no callback is | |
// provided, the received data will be written to console.log(). | |
(function($) { | |
$.Stream = function(url, callback) { | |
var xhr = internalXHR(); | |
var length = 0; | |
if (callback === undefined) { callback = function(text) { console.log(text); } } |
This file contains 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 java.io.*; | |
/** Source: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6206835 */ | |
public class BOMUtil { | |
public final static int NONE=-1; | |
public final static int UTF32BE=0; | |
public final static int UTF32LE=1; | |
public final static int UTF16BE=2; | |
public final static int UTF16LE=3; | |
public final static int UTF8=4; |
This file contains 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.apache.log4j.Logger; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.CommandLineRunner; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.integration.channel.DirectChannel; | |
import org.springframework.integration.channel.QueueChannel; | |
import org.springframework.messaging.support.GenericMessage; | |
import org.springframework.util.Assert; |
This file contains 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
@echo off | |
setlocal EnableDelayedExpansion | |
for /f %%A in ('forfiles /s /m *.go /c "cmd /c echo @relpath"') do SET "files=!files! %%~A" | |
go build %files% | |
ENDLOCAL |
This file contains 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 ( | |
"io/ioutil" | |
"os" | |
"log" | |
"os/exec" | |
"bytes" | |
) |
This file contains 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 fmtPassphrase(args) { return true; } | |
fmtPassphrase(args)L1388: strength = 3 |
This file contains 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 | |
/** | |
* PDF exporter for Mediawiki. This will load a specified content page and | |
* will append a seperate, specified cover page to the returning document. | |
* | |
* Requirements: | |
* - PHP 5.1+ | |
* - wkhtmltox (wkhtmltopdf) 0.12+ (http://www.wkhtmltopdf.org) | |
* - KnpLabs Snappy (https://github.com/KnpLabs/snappy/) | |
* - PDF Merger for PHP (http://pdfmerger.codeplex.com/) |
OlderNewer