Skip to content

Instantly share code, notes, and snippets.

Avatar

nick nvurgaft

  • private
  • israel
View GitHub Profile
@nvurgaft
nvurgaft / ReportTest.class
Last active Dec 15, 2020
An example class that uses DynamicReports to generate demo a report with subreports and a timechart
View ReportTest.class
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;
@nvurgaft
nvurgaft / BigNumber.java
Last active Oct 27, 2019
Example Big Number implementation in Java
View BigNumber.java
/**
* Created by Nick on 1/28/2017.
*/
public class BigNumber {
private Node head = null;
public BigNumber(BigNumber other) {
Node currentOther = other.getHead();
@nvurgaft
nvurgaft / service.rb
Created Jan 30, 2018
Runs a barebone Redmine installation as a Windows service and opens it to the outside on port 3000
View service.rb
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
@nvurgaft
nvurgaft / affix.js
Created Jun 9, 2017
AngularJS directive for affixing elements
View affix.js
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 {
@nvurgaft
nvurgaft / expressions.txt
Last active Mar 4, 2017
list of self authored regular repressions for common uses
View expressions.txt
\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
@nvurgaft
nvurgaft / Worker.js
Created Dec 25, 2016
A simple call and back using a webworker
View Worker.js
onmessage = function(event) {
console.debug("posting message: ", event.data);
postMessage(event.data);
}
@nvurgaft
nvurgaft / gist:8086853
Last active Nov 19, 2016
A simple HTTP/1.0 request client. This is a free software code, use fairly!
View gist:8086853
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netdb.h>
#include <errno.h>
View gist:e60fdfa3d6a9ba2d66324aa976f8238a
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;
@nvurgaft
nvurgaft / es6classes.js
Created Dec 19, 2015
Class declartion and inheritance in Javascript ES6
View es6classes.js
// a simple class declaration in es6
class Person {
constructor(fname, lname) {
this.fname = fname;
this.lname = lname;
}
toString() {
return (this.fname + " " + this.lname);
}
@nvurgaft
nvurgaft / index.html
Created Aug 15, 2015
Examples for using anonymouse functions with functional programming in Javascript
View index.html
<div>
<p id="text1"></p>
<p id="text2"></p>
</div>