Skip to content

Instantly share code, notes, and snippets.

View vega113's full-sized avatar

Yuri Z. vega113

  • Ramat Gan, Israel
  • 20:57 (UTC +03:00)
View GitHub Profile
@vega113
vega113 / run-dont-walt.txt
Created January 26, 2017 16:23
Run, Don't Walk---This Sucker Is Going Down
Run, Don't Walk---This Sucker Is Going Down
By David Stockman. Posted On Thursday, January 26th, 2017
The day traders and robo-machines have had their scheduled madcap frolic. They have not only crossed the magic 20,000 marker, but are also making the first few months of 2000, when the dotcom bubble reached it blow-off peak, look tame by comparison.
The truth is, the stock market wasn't wrong at 11:30 PM on November 8th when it greeted the suddenly shocking prospect of Donald Trump's victory with a 1,000 point sell-off in the futures market. But it's been dead wrong since then----rising 2,700 points since the wee hours of election night or 16% in the face of overwhelming evidence that the Trump Stimulus/Reflation story is a complete mirage.
Indeed, at 2140 on election day, the S&P 500 was already drastically overvalued at 24X reported earnings. Now it stands at 2300 and is truly in the skybox section of history----with its GAAP multiple having inflated to nearly 26X the $89 per share of earnings reported fo
@vega113
vega113 / check-balances.js
Created September 29, 2016 07:31
Check balances in bittrex
var bittrex = require('./node.bittrex.api.js');
bittrex.options({
'apikey': '',
'apisecret': '',
'stream': false,
'verbose': false,
'cleartext': false
});
@vega113
vega113 / JavaDateThreadSafetyExample.java
Last active October 6, 2017 12:45
Example of Java 6/7 threaf safety issue with SimpleDateFormat.
package com.yuri.java8.time;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* Created by yuri.zelikov on 1/11/2016.
@vega113
vega113 / reader.scala
Created January 6, 2016 07:59
Complementary code for introduction of the Reader in "Dead simple dependency injection video https://youtu.be/ZasXwtTRkio "
package me.reader
/**
* Created by yuri.zelikov on 1/6/2016.
*/
case class Reader[C, A](g: C => A) {
def apply(c: C) = g(c)
def map[B](f: A => B): Reader[C, B] = { c: C =>
Verifying that +vega113 is my blockchain ID. https://onename.com/vega113
@vega113
vega113 / daemon
Created March 4, 2014 12:59
Bash script that given a script runs it as a daemon
#!/bin/bash
#
#
#
# Start on runlevels 3, 4 and 5. Start late, kill early.
# chkconfig: 345 95 05
#
#
#!/bin/bash
@vega113
vega113 / TitleHelper
Created January 21, 2014 20:57
Another version of extractTitle for TitleHelper - not tested.
public static String getTitle(WaveId waveId, WaveletId waveletId, WaveMap waveMap,
ConversationUtil conversationUtil) {
String title = "";
WaveViewData wave =
AbstractSearchProviderImpl.buildWaveViewData(waveId, Lists.newArrayList(waveletId),
SolrSearchProviderImpl.matchesFunction, waveMap);
OpBasedWavelet wavelet = OpBasedWavelet.createReadOnly(wave.getWavelet(waveletId));
if (WaveletBasedConversation.waveletHasConversation(wavelet)) {
@vega113
vega113 / Extend.scala
Created November 30, 2013 06:52
Extend existing companion object
implicit class FutureCompanionOps(f: Future.type) extends AnyVal {
def userInput(message: String): Future[String] = Future {
readLine(message)
}
}
class FutureCompanionOps(f: Future.type) extends AnyVal {
def userInput(message: String): Future[String] = Future {
readLine(message)
package quickcheck
import common._
import org.scalacheck._
import Arbitrary._
import Gen._
import Prop._
abstract class QuickCheckHeap extends Properties("Heap") with IntHeap {
@vega113
vega113 / recfun.scala
Created September 23, 2013 05:12
Assignment Week 1: Functions & Evaluations
package recfun
import common._
object Main {
def main(args: Array[String]) {
println("Pascal's Triangle")
for (row <- 0 to 10) {
for (col <- 0 to row)
print(pascal(col, row) + " ")
println()