View ReportTest.class
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.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.PreparedStatement; | |
import java.sql.ResultSet; | |
import java.sql.ResultSetMetaData; | |
import java.sql.SQLException; | |
import java.sql.Statement; | |
import java.util.Date; | |
import java.util.stream.Collectors; | |
import java.util.stream.Stream; |
View service.rb
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
REDMINE_DIR = 'C:\redmine\redmine-3.4.4\redmine-3.4.4' | |
LOG_FILE = "#{REDMINE_DIR}\\log\\service.log" | |
begin | |
require 'win32/daemon' | |
include Win32 | |
class RedmineService < Daemon | |
def service_init |
View affix.js
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
angular.module('affix', []).directive('affix', [function () { | |
return { | |
restrict: 'A', | |
scope: {offset: "="}, | |
link: function (scope, element, attrs) { | |
var offset = Number.isFinite(scope.offset) ? scope.offset : 300; | |
var onScroll = function () { | |
if (window.pageYOffset >= offset) { | |
element.addClass('affix'); // add affix class | |
} else { |
View expressions.txt
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
\b[0-9a-f]{32}\b | |
This expression will stricly match an MD5 string | |
"d41d8cd98f00b204e9800998ecf8427e" will match | |
\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b | |
This expression will stricly match a canonical UUID string |
View BigNumber.java
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
/** | |
* Created by Nick on 1/28/2017. | |
*/ | |
public class BigNumber { | |
private Node head = null; | |
public BigNumber(BigNumber other) { | |
Node currentOther = other.getHead(); |
View Worker.js
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
onmessage = function(event) { | |
console.debug("posting message: ", event.data); | |
postMessage(event.data); | |
} |
View gist:e60fdfa3d6a9ba2d66324aa976f8238a
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
var ISet = function(array) { | |
this.list = array ? toSet(array) : []; | |
}; | |
ISet.prototype.add = function(inValue) { | |
if (exists(this.list, inValue) < 0) { | |
this.list.push(inValue); | |
return true; | |
} | |
return false; |
View es6classes.js
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
// a simple class declaration in es6 | |
class Person { | |
constructor(fname, lname) { | |
this.fname = fname; | |
this.lname = lname; | |
} | |
toString() { | |
return (this.fname + " " + this.lname); | |
} |
View index.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
<div> | |
<p id="text1"></p> | |
<p id="text2"></p> | |
</div> |
View crawler.java
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.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.net.HttpURLConnection; | |
import java.net.URL; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class Main { |
NewerOlder