Skip to content

Instantly share code, notes, and snippets.

View mumoshu's full-sized avatar
๐Ÿ 
Working from home

Yusuke Kuoka mumoshu

๐Ÿ 
Working from home
View GitHub Profile
@sadache
sadache / gist:4714280
Last active July 14, 2022 15:09
Playframework: Async, Reactive, Threads, Futures, ExecutionContexts

Asynchronicity is the price to pay, you better know what you're paying for...

Let's share some vocabulary first:

Thread: The primitive responsible of executing code on the processor, you can give an existing (or a new) Thread some code, and it will execute it. Normally you can have a few hundreds on a JVM, arguments that you can tweak your way out to thousands. Worth noting that multitasking is achieved when using multiple Threads. Multiple Threads can exist for a single processor in which case multitasking happens when this processor switches between threads, called context switching, which will give the impression of things happenning in parallel. An example of a direct, and probably naive, use of a new Thread in Java:

public class MyRunnable implements Runnable {
  public void run(){
 System.out.println("MyRunnable running");
@gdamjan
gdamjan / README.md
Last active May 25, 2025 01:21
Setup for an easy to use, simple reverse http tunnels with nginx and ssh. It's that simple there's no authentication at all. The end result, a single ssh command invocation gives you a public url for your web app hosted on your laptop.

What

A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.

Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).

Requirements

@zerosum
zerosum / Euler0009.scala
Last active December 11, 2015 09:09
Project Euler: Problem 9
object Euler0009 {
private val max = 1000
def main(args: Array[String]): Unit = {
println(
buildTriplets(1, 2, Nil).filter(_.isPitagolyan).map(_.product)
)
}
@stas
stas / deploy.rb
Created January 15, 2013 15:34
Mina Deploy Task (Rails + Puma + Delay Job + rbenv)
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rbenv' # for rbenv support. (http://rbenv.org)
# require 'mina/rvm' # for rvm support. (http://rvm.io)
# Basic settings:
# domain - The hostname to SSH to.
# deploy_to - Path to deploy into.
# repository - Git repo to clone from. (needed by mina/git)
@pigeon6
pigeon6 / Unlit-CastShadow.shader
Created December 7, 2012 23:11
Unlit texture shader which casts shadow on Forward/Defered
// Unlit texture shader which casts shadow on Forward/Defered
Shader "Unlit/Texture CastShadow" {
Properties {
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
}
SubShader {
Tags {"Queue"="Opaque" }
LOD 100
@tkawachi
tkawachi / fluentd
Created November 27, 2012 08:55 — forked from higebu/fluentd
/etc/init.d/fluentd
#!/bin/bash
PID_FILE=/var/run/fluentd.pid
CONF_FILE=/etc/fluent/fluent.conf
LOG_FILE=/var/log/fluent/fluent.log
DEFAULT_RVM_PATH=/usr/local/rvm
JEMALLOC=jemalloc.sh
F_USER=fluentd
F_GROUP=fluentd
@non
non / gist:4064198
Created November 13, 2012 05:47
Add map + flatMap to Function1-3 with no overhead
object RichF {
implicit class RichF1[A, Z](val f: A => Z) extends AnyVal {
def map[Y](g: Z => Y): A => Y =
(a: A) => g(f(a))
def flatMap[Y](g: Z => A => Y): A => Y =
(a: A) => g(f(a))(a)
}
implicit class RichF2[A, B, Z](val f: (A, B) => Z) extends AnyVal {
def map[Y](g: Z => Y): (A, B) => Y =
2 ๏ผšๆฐดๅ…ˆๆกˆๅ็„กใ„ไบบ๏ผš2011/12/03(ๅœŸ) 11:12:19.45 ID:bTIMyqpW0
ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€ ใ€€ ,;' '" '' ใ‚›''" ใ‚›' ';;,,
ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€๏ผˆrใƒฝ,;''"""''ใ‚›ใ‚›ใ‚›'';, ๏พ‰๏ฝ’๏ผ‰
ใ€€ใ€€ใ€€ใ€€ใ€€ใ€€,;'ใ‚› i ๏ผฟใ€€ใ€€ใ€๏ผฟ iใƒฝใ‚›';,ใ€€ใ€€ใ€€ใ€€ใŠๅ‰ใใ‚Œ้–ขๆ•ฐๅž‹่จ€่ชžใงใ‚‚ๅŒใ˜ไบ‹่จ€ใˆใ‚“ใฎ๏ผŸ
ใ€€ใ€€ใ€€ใ€€ใ€€ ,;'" ''| ใƒฝใƒปใ€‰ใ€€ใ€ˆใƒปใƒŽ |๏พžใ‚› `';,
ใ€€ใ€€ใ€€ใ€€ใ€€ ,;''ใ€€"|ใ€€ใ€€ โ–ผใ€€ใ€€ |๏พžใ‚›ใ€€`';,
ใ€€ใ€€ใ€€ใ€€ใ€€ ,;''ใ€€ใ€€ใƒฝ๏ผฟไบบ๏ผฟ /ใ€€ใ€€,;'_
ใ€€ใ€€ใ€€ใ€€ ๏ผ๏ฝผใ€ใ€€ ใƒฝโŒ’โŒ’ /ใ€€ใ€€ ๏พ˜ใ€€๏ผผ
ใ€€ใ€€ใ€€ใ€€|ใ€€ใ€€ใ€€"๏ฝ’,,ใ€€๏ฝ€"'''๏พžยดใ€€ใ€€,,๏พใ‚›ใ€€ใ€€ |
@hayajo
hayajo / changelog_en.md
Last active April 1, 2025 14:37
ChangeLog ใ‚’ๆ”ฏใˆใ‚‹่‹ฑ่ชž

ChangeLog ใ‚’ๆ”ฏใˆใ‚‹่‹ฑ่ชž

ChangeLog ใ‚’ๆ›ธใ้š›ใซใ‚ˆใไฝฟใ‚ใ‚Œใ‚‹่‹ฑ่ชžใ‚’ใพใจใ‚ใพใ—ใŸใ€‚

ใปใจใ‚“ใฉๅผ•็”จใงใ™ใ€‚

ๅŸบๆœฌๅฝข

@dergachev
dergachev / README.md
Created October 10, 2012 16:49
Vagrant tutorial

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM