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
| window.____addEventListener____ = window.addEventListener; | |
| window.addEventListener = function(type, listener, options) { | |
| if (type === "scroll") { | |
| ____listener____ = listener; | |
| previousScrollY = 0; | |
| listener = function(event) { | |
| if (window.scrollY >= previousScrollY) { | |
| ____listener____(event); | |
| } | |
| previousScrollY = window.scrollY; |
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
| # https post a payload to a web server with basic authentication | |
| require 'net/https' | |
| require 'benchmark' | |
| request_count = 1 | |
| thread_count = 10 | |
| protocol = 'http' # or 'https' | |
| host = 'www.example.com' | |
| port = 80 | |
| path = '/path/file' |
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 com.github.lachlan.xml.splitter; | |
| public class Main { | |
| public static final int BUFFER_SIZE = 8192; | |
| public static void main(String[] args) { | |
| Main main = new Main(); | |
| if (args.length < 2) { | |
| System.out.println("Usage: "); |
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 ( | |
| "encoding/base64" | |
| "encoding/hex" | |
| "github.com/docopt/docopt.go" | |
| "github.com/tarm/goserial" | |
| "log" | |
| "strconv" | |
| ) |
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 'nokogiri' | |
| # SAX parser which counts the occurrence of elements and | |
| # attributes in an XML document | |
| class Counter < Nokogiri::XML::SAX::Document | |
| attr_reader :counts | |
| def initialize | |
| @counts, @path, @content = Hash.new(0), [], '' | |
| end |
This file has been truncated, but you can view the full file.
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 | |
| a | |
| aa | |
| aal | |
| aalii | |
| aam | |
| Aani | |
| aardvark | |
| aardwolf |
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
| var fs = require('fs'), | |
| filename = 'words.txt', | |
| encoding = 'utf-8'; | |
| fs.readFile(filename, encoding, function(err, data) { | |
| if (err) throw err; | |
| var lines = data.split('\n'); | |
| // trim whitespace, and convert to lower case |
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
| filename = "words.txt" | |
| words = [] | |
| class String | |
| def is_anagram?(other) | |
| self.length == other.length && self.chars.sort == other.chars.sort | |
| end | |
| end | |
| # build a list words from the file |
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
| // Every webMethods Integration Server service has exactly one input | |
| // argument: the pipeline. | |
| // | |
| // The pipeline is like a java.util.Map object that gets passed to each | |
| // service that gets called. (It's actually a com.wm.data.IData object, | |
| // which unfortunately doesn't implement java.util.Map.) | |
| // | |
| // Because objects are passed by reference, every service called can alter | |
| // the keys and values in the pipeline. | |
| // |
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
| // Every webMethods Integration Server service has exactly one input | |
| // argument: the pipeline. | |
| // | |
| // The pipeline is like a javascript object that gets passed to each | |
| // service that gets called. (It's actually a com.wm.data.IData object, | |
| // which is essentially a hash table.) | |
| // | |
| // Because objects are passed by reference, every service or function | |
| // called can alter the keys and values in the pipeline. | |
| // |
NewerOlder