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 ( | |
"bytes" | |
"fmt" | |
"io" | |
"strings" | |
"unicode" | |
"golang.org/x/net/html" |
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 ( | |
"flag" | |
"log" | |
"net/http" | |
"strings" | |
) | |
// FileSystem custom file system handler |
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
// Note: cache should not be re-used by repeated calls to JSON.stringify. | |
var cache = []; | |
JSON.stringify(req, function(key, value) { | |
if (typeof value === 'object' && value !== null) { | |
if (cache.indexOf(value) !== -1) { | |
// Circular reference found, discard key | |
return; | |
} | |
// Store value in our collection |
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
// catfile.go | |
// one possible way to concatenate files quickly | |
// inspired by http://randyzwitch.com/gnu-parallel-medium-data/ | |
// runtime on mb pro15 (late 2013): 352k files concatentaed in 2m48sec | |
// | |
package main | |
import ( |
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
. $topsrcdir/browser/config/mozconfig | |
export MOZ_APP_NAME=securebrowser | |
export MOZ_APP_DISPLAYNAME=SecureBrowser | |
mk_add_options MOZ_APP_NAME=securebrowser | |
mk_add_options MOZ_APP_DISPLAYNAME=SecureBrowser | |
ac_add_options --enable-application=browser | |
mk_add_options MOZ_OBJDIR=c:/mozilla-objs-msvc |
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
// | |
// File: fsevents_windows.go | |
// Date: October 29, 2013 | |
// Author: Peter Krnjevic <[email protected]>, on the shoulders of many others | |
// | |
// This code sample is released into the Public Domain. | |
// | |
package fsevents | |
import ( |
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
class ThumbService | |
constructor: (@$log, @$q, @$resource, @mainService) -> | |
console.log "ThumbService: constructor called" | |
@url = @mainService.url(true)+"rest/thumbs/:value/:count" | |
@thumbs_url = @$resource @url | |
@sf = [] | |
@lines = [] | |
@thumbs = [] | |
@thumb_size = 150 | |
@max_thumbs = 200 |
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
class MyFunc | |
constructor: -> | |
@name = "default name" | |
return "Hello from MyFunc(). this.name = " + @name | |
$get: -> | |
@name = "new name" | |
"Hello from MyFunc.$get(). this.name = " + @name | |
app = angular.module("app", []) |
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
// | |
// File: inotify-example.cpp | |
// Date: July 16, 2013 | |
// Author: Peter Krnjevic <[email protected]>, on the shoulders of many others | |
// | |
// This is a simple inotify sample program monitoring changes to "./tmp" directory (create ./tmp beforehand) | |
// Recursive monitoring of file and directory create and delete events is implemented, but | |
// monitoring pre-existing "./tmp" subfolders is not. | |
// A C++ class containing a couple of maps is used to simplify monitoring. | |
// The Watch class is minimally integrated, so as to leave the main inotify code |
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
C.epeg_decode_size_set(im.cim, C.int(width), C.int(height)) | |
C.epeg_quality_set(im.cim, C.int(quality)) | |
var scaledData *C.uchar | |
var scaledSize C.int | |
C.epeg_memory_output_set(im.cim, &scaledData, &scaledSize) | |
C.epeg_encode(im.cim) |
NewerOlder