Skip to content

Instantly share code, notes, and snippets.

View vega113's full-sized avatar

Yuri Z. vega113

  • Ramat Gan, Israel
  • 02:26 (UTC +03:00)
View GitHub Profile
@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
Verifying that +vega113 is my blockchain ID. https://onename.com/vega113
@vega113
vega113 / wiab_server_exception.java
Created April 15, 2011 11:33
The exception happens every ~10 seconds on the WIAB server during last couple days.
2011-04-15 09:05:58.760:DBUG::async request [GET /socket.io/xhr-multipart/]@5547667 org.eclipse.jetty.server.Request@54a693
2011-04-15 09:05:58.760:DBUG::REQUEST /socket.io/xhr-multipart/ on org.eclipse.jetty.server.nio.SelectChannelConnector$2@1f0940a
2011-04-15 09:05:58.760:DBUG::sessionManager=org.eclipse.jetty.server.session.HashSessionManager@365dc0
2011-04-15 09:05:58.760:DBUG::session=null
2011-04-15 09:05:58.760:DBUG::servlet=org.waveprotocol.box.server.rpc.ServerRpcProvider$WaveSocketIOServlet-18074979
2011-04-15 09:05:58.760:DBUG::servlet holder= org.waveprotocol.box.server.rpc.ServerRpcProvider$WaveSocketIOServlet-18074979
2011-04-15 09:05:58.760:DBUG::chain= null
2011-04-15 09:05:58.760:WARN::Committed before 404 null
2011-04-15 09:05:58.760:WARN::/socket.io/xhr-multipart/
if (UserAgent.isFirefox()) {
popup =
PopupFactory.createPopup(this.getElement(), new RelativePopupPositioner() {
@Override
public void setPopupPositionAndMakeVisible(Element relative, final Element p) {
ScheduleCommand.addCommand(new Scheduler.Task() {
@Override
public void execute() {
p.getStyle().setLeft((RootPanel.get().getOffsetWidth() - p.getOffsetWidth()) / 2, Unit.PX);
ompiling module org.waveprotocol.box.webclient.WebClientDev
[java] Validating newly compiled units
[java] [ERROR] Errors in 'file:/C:/cygwin/home/vega/wave-protocol/src/org/waveprotocol/box/webclient/client/HistorySupport.java'
[java] [ERROR] Line 24: The import org.waveprotocol.box.webclient.client.events.Log cannot be resolved
[java] [ERROR] Line 37: Log cannot be resolved to a type
[java] [ERROR] Line 37: Log cannot be resolved
[java] [ERROR] Line 49: Log cannot be resolved to a type
[java] [ERROR] Line 52: Log cannot be resolved to a type
[java] [ERROR] Errors in 'file:/C:/cygwin/home/vega/wave-protocol/src/org/waveprotocol/box/webclient/client/RemoteWaveViewService.java'
[java] [ERROR] Line 29: The import org.waveprotocol.box.webclient.client.events.Log cannot be resolved
@vega113
vega113 / DeltaStoreBasedWaveletState.java
Created October 10, 2011 18:43
A snippet with sample method modified to return ListebaleFuture
class DeltaStoreBasedWaveletState implements WaveletState {
// Some more declarations.
** Executor to evaluate results from future when they become ready. */
private final Executor continuationExecutor = Executors.newSingleThreadExecutor();
/** Keyed by appliedAtVersion. */
private final ConcurrentMap<HashedVersion, ByteStringMessage<ProtocolAppliedWaveletDelta>>
appliedDeltasToPersist =
new ConcurrentHashMap<HashedVersion, ByteStringMessage<ProtocolAppliedWaveletDelta>>();
@vega113
vega113 / gist:4545324
Created January 16, 2013 07:40
Source for viewhits gadget
<?xml version="1.0" encoding="UTF-8"?>
<Module>
<ModulePrefs title="View Hits" width="72" height="25">
<Require feature="wave" />
</ModulePrefs>
<Content type="html">
<![CDATA[
<div>
@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()
package quickcheck
import common._
import org.scalacheck._
import Arbitrary._
import Gen._
import Prop._
abstract class QuickCheckHeap extends Properties("Heap") with IntHeap {
@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)