This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.json4s._ | |
import org.json4s.JsonDSL._ | |
import org.json4s.jackson.JsonMethods._ | |
object Plotly { | |
val scriptUrl: String = "https://cdn.plot.ly/plotly-latest.min.js" | |
val stylePolyfill: String = """ | |
|.plotly .modebar-btn { | |
| display: inline-block; | |
|} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rpcserver="" | |
rpcport="" | |
rpcuser="" | |
rpcpassword="" | |
method="help" | |
paramsjson="[]" | |
id="$(uuidgen)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.collection.mutable.HashMap | |
object SuffixTree { | |
class State() { | |
val transitions: HashMap[Char,Transition] = HashMap.empty[Char,Transition] | |
var suffixLink: Option[State] = None | |
def printDebugString(prefix: String, label: String): Unit = { | |
val kvpairs = transitions.toSeq.sortBy(_._1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { HttpClient } from '@angular/common/http'; | |
import { RequestBackend } from './request-backend'; | |
import * as request from 'request'; | |
let backend = new RequestBackend(request); | |
let http = new HttpClient(backend); | |
let response = http.get('https://www.google.com/'); | |
response.subscribe(res => console.log(res)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.openqa.selenium.WebDriver | |
import org.openqa.selenium.remote.RemoteWebDriver | |
import org.openqa.selenium.chrome.ChromeDriver | |
import org.openqa.selenium.chrome.ChromeOptions | |
import org.jsoup.Jsoup | |
import org.jsoup.nodes.Document | |
import org.jsoup.nodes.Element | |
import java.io.File |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Observable, Observer } from 'rxjs'; | |
import { interval } from 'rxjs'; | |
import { take, tap, map } from 'rxjs/operators'; | |
function observableToAsyncIterator<T>(observable: Observable<T>): AsyncIterator<T> { | |
const pushes = []; | |
const pulls = []; | |
function createPromiseWithExecutor() { | |
let executor = { | |
resolve: undefined, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import uuid | |
import json | |
class Plotly(object): | |
@staticmethod | |
def newPlot(data, layout=None, config=None): | |
scriptUrl = 'https://cdn.plot.ly/plotly-latest.min.js' | |
divId = str(uuid.uuid1()) | |
divTag = '<div id="%(divId)s"></div>' % { 'divId': divId } | |
if not isinstance(data, list): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <cstring> | |
#include <sstream> | |
#include <vector> | |
#include <map> | |
#include <mutex> | |
#include <algorithm> | |
#include <curl/curl.h> | |
#include <boost/algorithm/string.hpp> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.collection.mutable.HashMap | |
import scala.collection.mutable.ArrayBuffer | |
sealed trait Symbol[C] extends Ordered[Symbol[C]] { | |
def isTerminal(): Boolean | |
} | |
case class CharacterSymbol[C: Ordering](val character: C) extends Symbol[C] { | |
def isTerminal(): Boolean = false | |
def compare(that: CharacterSymbol[C]): Int = Ordering[C].compare(this.character, that.character) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import pygame | |
from enum import IntEnum | |
pygame.init() | |
size = width, height = 1000, 1000 | |
black = (0, 0, 0) |
OlderNewer