Skip to content

Instantly share code, notes, and snippets.

View swhgoon's full-sized avatar
🌄
Working

SwhGo_oN swhgoon

🌄
Working
View GitHub Profile
<script>
$.as.route.page('settings', () => {
if(!S.user.is){ return $.as.route('hi') }
$.as('#settings', S.user);
;(() => {
$('#pet').on('keyup', function(){ $('.pet').text(this.value.length + ' letters.') });
$('#kiss').on('keyup', function(){ $('.kiss').text(this.value.length + ' letters.') });
S.user.get('settings').get('pet').on(function(l){ $('#pet').val(Gun.text.random(l, '*')) });
@eed3si9n
eed3si9n / sbt-plugin-ranking-2017-08-05.md
Last active June 8, 2018 09:15 — forked from xuwei-k/sbt-plugin-ranking-2014-02-25
List of sbt plugins sorted by GitHub stars. This was generated using https://gist.github.com/eed3si9n/ea4ceef0c5e5c07d6e62c87bea029f88, then augmented by hand.
@muratgozel
muratgozel / isEqual.js
Last active May 28, 2017 13:08
Javascript equality checker.
const isEqual = function(inputs = []) {
// Checks an element if js object.
const isObject = function(data) {
return Object.prototype.toString.call(data) === '[object Object]';
};
// Sorts given object by its keys.
const sortObjectByKey = function(obj) {
if (!obj) return {};
return Object.keys(obj).sort().reduce((initialVal, item) => {
@sagivo
sagivo / gist:3a4b2f2c7ac6e1b5267c2f1f59ac6c6b
Last active November 2, 2025 20:26
webRTC stun / turn server list
to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice
stun:
stun.l.google.com:19302,
stun1.l.google.com:19302,
stun2.l.google.com:19302,
stun3.l.google.com:19302,
stun4.l.google.com:19302,
stun.ekiga.net,
stun.ideasip.com,
package wcatest
import org.scalajs.dom
import org.scalajs.dom.crypto.{CryptoKey, _}
import org.scalajs.dom.raw.Promise
import scala.concurrent.Future
import scala.scalajs.concurrent.JSExecutionContext.Implicits.runNow
import scala.scalajs.js
import scala.scalajs.js.JSApp
@mkotsbak
mkotsbak / PlayAutowire.scala
Last active May 20, 2016 18:41
Play server wiring to get Autowire to work with extra request information like IP-addresses and authentication. See how to use it here: https://gist.github.com/mkotsbak/122940aa003db9708093
package controllers
import play.api.http.{ContentTypes, ContentTypeOf}
import upickle.Js
import upickle.default._
import play.api.mvc._
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
@rherrmann
rherrmann / InitLearningTest.java
Last active July 29, 2024 09:00
'Learning Tests' that use the JGit API to create new Git repositories: http://www.codeaffine.com/2015/05/06/jgit-initialize-repository/
/***************************************************************************************************
* Copyright (c) 2015 Rüdiger Herrmann
* All rights reserved. This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available
* at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Rüdiger Herrmann - initial API and implementation
**************************************************************************************************/
package com.codeaffine.jgit.example;
@retronym
retronym / indylambda.md
Last active February 5, 2022 10:47
indylambda: Putting invokedynamic to work for Scala

indylambda: Putting invokedynamic to work for Scala

Java 8 introduced lambdas to the Java language. While the design choices differ in many regards from Scala's functions, the underlying mechanics used to represent Java lambdas is flexible enough to be used as a target for the Scala compiler.

Lambdas in Java

Java does not have canonical heirarchy of generic function types (ala scala.FunctionN), but instead allows a lambda to be used as a shorthand for an anonymous implementation of an Functional Interface

Here's an example of creating a predicate that closes over one value:

@HanSolo
HanSolo / JavaFX_ePaper
Created January 1, 2015 13:37
JavaFX create snapshot and save as xbm file
// create the xbm image from a given node
createSnapshotAndWriteXbm(pane, "epaperImage");
// display the image on the e-paper display
try {
Process p1 = new ProcessBuilder("/bin/bash", "-c", "/home/pi/gratis/PlatformWithOS/driver-common/xbm2bin < /home/pi/epaper/yotaclock.xbm > /dev/epd/display").start();
p1.waitFor(1, TimeUnit.SECONDS);
Process p2 = new ProcessBuilder("/bin/bash", "-c", "echo U > /dev/epd/command").start();
p2.waitFor(1, TimeUnit.SECONDS);
} catch (InterruptedException | IOException e) {
@hendrikebbers
hendrikebbers / gist:92dd7a58666a59d873d3
Created November 11, 2014 22:20
hand drawing effect with JavaFX
package com.guigarage.incubator.wobble;
import javafx.application.Application;
import javafx.geometry.Point2D;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.shape.*;
import javafx.stage.Stage;