View ShellScriptInBAT.bat
@rem '
@echo off
set P="/mnt/%~f0"
set P=%P:\=/%
set P=%P::=%
set P=%P:/mnt/C/=/mnt/c/%
set P=%P:/mnt/D/=/mnt/d/%
bash.exe %P% %*
View open
#!/bin/bash
if [ $# -eq 0 ]; then
DIR=.
else
DIR=$*
fi
explorer.exe $DIR
View JavaFizzBuzz.java
import java.util.stream.IntStream;
public class Main {
public static void main(String[] args) {
IntStream.range(1, 100).boxed()
.map(n -> n % 15 == 0 ? "FizzBuzz"
: n % 5 == 0 ? "Buzz"
: n % 3 == 0 ? "Fizz"
: n)
.forEach(System.out::println);
View ch_bg_color.sh
#!/bin/bash
R=$1
G=$2
B=$3
/usr/bin/osascript <<EOF
tell application "iTerm"
tell current session of current window
set background color to {$(($R*65535/255)), $(($G*65535/255)), $(($B*65535/255))}
View Makefile
boot.bin: boot.asm
nasm -f bin boot.asm -o boot.bin
qemu: boot.bin
qemu-system-x86_64 -curses boot.bin
clean:
rm *.bin
View Application.java
private FormFactory formFactory;
private Form<SearchForm> form() {
return formFactory.form(SearchForm.class);
}
public Result index() {
val form = new SearchForm();
return ok(views.html.index.render(form().fill(form)));
}
View gist:3706d19a2bc948611d39ecb490a917ec
seq 1 99999999999 | awk '{
for(i=1;i<=11;i++){
a=int($0/(10^(i-1)));
b=a-int(a/10)*10;
if(i<=6){
sum+=b*(i+1)
} else {
sum+=b*(i-5)
}
};
View SimpleWebServer.java
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.util.Scanner;
import java.net.ServerSocket;
import java.net.Socket;
View packages.config
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="lhaplus" />
<package id="windowslivemail" />
<package id="adobereader" />
<package id="googlejapaneseinput" />
<package id="git" />
<package id="google-chrome-x64 " />
<package id="firefox" />
View server
#!/usr/local/bin/python
import socket
import os
from subprocess import Popen, PIPE
PORT_NO = 8080
HOSTNAME = ''
SCRIPT = "listen"
def main():