Skip to content

Instantly share code, notes, and snippets.

View eleco's full-sized avatar
🏠
Working from home

Elec eleco

🏠
Working from home
View GitHub Profile
@eleco
eleco / BoundedPriorityQueue.java
Created March 4, 2015 14:19
Bounded priority queue
import java.util.PriorityQueue;
public class BoundedPriorityQueue<T> extends PriorityQueue<T> {
final private int maxSize ;
public BoundedPriorityQueue(int maxSize) {
this.maxSize = maxSize;
}
@eleco
eleco / ServoDemo.java
Created April 11, 2015 21:22
netflix servo demo
package servo;
import com.netflix.servo.monitor.Counter;
import com.netflix.servo.monitor.MonitorConfig;
import com.netflix.servo.monitor.Monitors;
import com.netflix.servo.monitor.PeakRateCounter;
public class ServoDemo {
@eleco
eleco / MyBenchmark.java
Created April 16, 2015 19:23
Simple Servo benchmark test
package jmh;
import com.netflix.servo.monitor.Counter;
import com.netflix.servo.monitor.MaxGauge;
import com.netflix.servo.monitor.MonitorConfig;
import com.netflix.servo.monitor.Monitors;
@eleco
eleco / StringInternTest.java
Created June 30, 2015 08:44
string intern benchmark with JMH
package jmh;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.profile.GCProfiler;
import org.openjdk.jmh.profile.StackProfiler;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.options.Options;
import org.openjdk.jmh.runner.options.OptionsBuilder;
import java.util.ArrayList;
import java.util.List;
@eleco
eleco / gist:309d8721272258ac8203
Last active December 6, 2015 20:57
angular v1 route debugging
// Credits: Adam's answer in http://stackoverflow.com/a/20786262/69362
// Paste this in browser's console
var $rootScope = angular.element(document.querySelectorAll("[ui-view]")[0]).injector().get('$rootScope');
$rootScope.$on('$stateChangeStart',function(event, toState, toParams, fromState, fromParams){
console.log('$stateChangeStart to '+toState.to+'- fired when the transition begins. toState,toParams : \n',toState, toParams);
});
$rootScope.$on('$stateChangeError',function(event, toState, toParams, fromState, fromParams){
console.log('$stateChangeError - fired when an error occurs during transition.');
@eleco
eleco / ReadMe.md
Created June 16, 2016 19:34 — forked from dobesv/ReadMe.md
Login script for custom auth0 database to auth via WordPress XML-RPC

You must provide the following configuration variables:

  1. WP_XMLRPC_URL = https://www.yourdomain.com/xmlrpc.php (replace with your domain and use http:// if you don't have SSL support)
  2. WP_ADMIN_USER = admin (use your own admin username)
  3. WP_ADMIN_PASSWORD = somepassword (use your own admin password)
public class PerformanceUtil {
/*
A utility to detect slow running functions
*/
public static final int WARN_THRESHOLD_MILLIS =1000;
public static <T> T timed(Executable<T> function) {
@eleco
eleco / RandomBitcoinWalk.java
Created April 15, 2018 15:17
An experiment in generating a random walk for the bitcoins prices
package com.megalit;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

Executive Program in Algorithmic Trading (QuantInsti)

Python Sessions by Dr. Yves J. Hilpisch | The Python Quants GmbH

Online, 27. & 28. January 2018

@eleco
eleco / trending_pennystocks.py
Created May 2, 2021 14:03 — forked from lipton-green-tea/trending_pennystocks.py
A piece of code that sorts sentimentinvestor.com stocks to find promising penny stocks based on fundamental data.