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
import asyncio
from pyppeteer import launch
async def get_article_titles(keywords):
# launch browser in headless mode
browser = await launch({"headless": False, "args": ["--start-maximized"]})
# create a new page
page = await browser.newPage()
A backup of http://sites.google.com/site/redcodenl/creating-shazam-in-java-1 just in case
Why is this necessary? Read http://sites.google.com/site/redcodenl/patent-infringement
Please fork, tweet about, etc.
----
Creating Shazam in Java
A couple of days ago I encountered this article: How Shazam Works
This got me interested in how a program like Shazam works… And more importantly, how hard is it to program something similar in Java?
@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.

Executive Program in Algorithmic Trading (QuantInsti)

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

Online, 27. & 28. January 2018

@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;
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 / 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)
@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 / 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 / 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;