This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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
diff --git a/src/app/panels/table/module.html b/src/app/panels/table/module.html | |
index b1aa49f..515ba06 100644 | |
--- a/src/app/panels/table/module.html | |
+++ b/src/app/panels/table/module.html | |
@@ -52,6 +52,24 @@ | |
padding: 10px; | |
border: 1px solid #666; | |
} | |
+ .table-field-level-error { | |
+ border-radius: 3px; |
This file contains 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
l = ["1", "32", "hello", "3", "my 43"] | |
return [int(_) for _ in filter(lambda _: _.isdigit(), l)] |
This file contains 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
val timeout = new TimeValue(600000) | |
val requestBuilder = client | |
.prepareSearch(index) | |
.setTypes(indexType) | |
.setSize(size.getOrElse(5000)) | |
.setScroll(timeout) | |
.setSearchType(SearchType.SCAN) | |
query foreach requestBuilder.setQuery |
This file contains 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
package com.digsolab.euler.util.format | |
import org.scalatest.FlatSpec | |
import org.scalatest.matchers.MustMatchers | |
import com.fasterxml.jackson.annotation.JsonInclude | |
import com.fasterxml.jackson.annotation.JsonInclude.Include | |
case class Person(name: String, age: Int) |
This file contains 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
ZSH=$HOME/.oh-my-zsh | |
ZSH_THEME="robbyrussell" | |
plugins=(osx brew git sbt bower) | |
source $ZSH/oh-my-zsh.sh | |
PROMPT='%{$fg[yellow]%}➤%{$fg_bold[green]%}%p %{$fg[cyan]%}%c $ % %{$reset_color%}' |
This file contains 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
--- | |
- name: install supervisord | |
apt: pkg=supervisor state=present | |
- name: add nsq group | |
group: name=nsq | |
- name: add nsq user | |
user: name=nsq group=nsq |
This file contains 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
def series(items: List[Int]) { | |
if (items.nonEmpty) { | |
Future { | |
doHeavyWork(items.head) | |
} onComplete { | |
case res => | |
// handler results | |
series(items.tail) | |
} |
This file contains 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
object ScaleFactor { | |
val T1MicroSpeed = 10.0 | |
def calcNeedInstances(avgSpeed: Int, queueSize: Int): Int = { | |
val taskPerHour = avgSpeed * 3600 | |
val maxInstances = math.ceil(avgSpeed / T1MicroSpeed) | |
queueSize / taskPerHour.toDouble match { | |
case h if h < 1 ⇒ math.ceil(maxInstances * h).toInt |
This file contains 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
object Solution extends App { | |
val bf = Array.newBuilder[String] | |
(1 to Console.readLine().toInt) | |
.map(_ => Console.readLine()) | |
.foreach(s => println(calc(s))) | |
@annotation.tailrec | |
def sum(n: Int, res: Int = 0): Int = if (n <= 0) res else sum(n - 1, res + n) |