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
<!-- https://github.com/howtographql/sangria/blob/master/src/main/resources/graphiql.html --> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="robots" content="noindex" /> | |
<meta name="referrer" content="origin" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<title>GraphiQL</title> | |
<style> |
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
class Debugger | |
def initialize(events) | |
@tp = TracePoint.new(*(events || %i[call b_call raise])) do |tp| | |
tp.binding.irb | |
end | |
@tp.disable | |
end | |
def trace(&block) | |
@tp.enable |
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
" general | |
set autoupdategist " gistの設定を自動反映 | |
let scrollstep = 150 | |
let fullpagescrollpercent = 100 | |
set smoothscroll | |
set noautofocus " サイトを開いた時に入力欄にフォーカスが奪われるのを抑止 | |
let searchlimit = 20 | |
let barposition = "bottom" |
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
package main | |
import ( | |
"log" | |
"net/http" | |
) | |
func main() { | |
log.Println("Server started. 0.0.0.0:8080") | |
http.ListenAndServe(":8080", http.HandlerFunc(fileHandler)) |
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 shapeless._ | |
import shapeless.labelled.FieldType | |
object ClassDiff extends App { | |
sealed abstract class Field(name: String) | |
case class FieldSame(name: String) extends Field(name) | |
case class FieldDiff[A](name: String, before: A, after: A) extends Field(name) | |
trait GenericDiff[HL <: HList] { |
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
package main | |
import ( | |
"database/sql" | |
"fmt" | |
_ "github.com/go-sql-driver/mysql" | |
"github.com/google/uuid" | |
"os" | |
"strings" | |
) |
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 skinny.orm.feature.NoIdCUDFeature | |
object Implicits { | |
implicit class Upserter[T](val orm: NoIdCUDFeature[T]) extends AnyVal { | |
def upsert(condition: SQLSyntax)(update: (SQLSyntax, Any)*)(insert: (SQLSyntax, Any)*)(implicit s: DBSession): Unit = { | |
orm.updateBy(condition).withNamedValues(update: _*) match { | |
case 1 => () | |
case 0 => | |
orm.createWithNamedValues(insert: _*) | |
() |
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.slf4j.LoggerFactory | |
trait LoggerProvider { | |
protected lazy val logger = new xLogger(this.getClass.getName) | |
} | |
private object xLogger { | |
def apply(name: String): xLogger = new xLogger(name) | |
} | |
class xLogger private (name: String) { | |
private lazy val logger = LoggerFactory.getLogger(name) |
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
case class MyObj() | |
def insert(c: MyObj, excludes: String*)(implicit s: DBSession): Id[MyObj] = { | |
import scala.reflect.runtime.{ universe => ru } | |
val clazz = c.getClass | |
def caseMap[T: ru.TypeTag: reflect.ClassTag](instance: T): Seq[(SQLSyntax, Any)] = { | |
val im = ru.runtimeMirror(clazz.getClassLoader).reflect(instance) | |
ru.typeOf[T] | |
.members |
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
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: nginx-conf | |
data: | |
nginx.conf: | | |
user nginx; | |
worker_processes 3; | |
error_log /var/log/nginx/error.log; | |
events { |