View steam-to-google-calendar.gs
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
const CALENDAR_ID = "YOUR_CALENDAR_ID"; | |
const STEAM_ID = "YOUR_STEAM_ID"; | |
const STEAM_API_KEY = "YOUR_STEAM_API_KEY"; | |
function run() { | |
const api = new SteamApi(STEAM_API_KEY); | |
const json = api.getPlayerSummary(STEAM_ID); | |
const gameid = json["gameid"]; | |
const gameextrainfo = json["gameextrainfo"]; | |
View mv-and-check-inode-fts.c
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
#include stdio.h | |
#include stdlib.h | |
#include fts.h | |
#include string.h | |
#include sys/stat.h | |
unsigned long get_inode(char *name) { | |
unsigned long inode; | |
struct stat stat_buf; | |
char path[255]; |
View mv-and-check-inode.c
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <dirent.h> | |
#include <string.h> | |
#include <sys/stat.h> | |
unsigned long get_inode(char *name) { | |
unsigned long inode; | |
struct stat stat_buf; | |
char path[255]; |
View ShellScriptInBAT.bat
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
@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
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
#!/bin/bash | |
if [ $# -eq 0 ]; then | |
DIR=. | |
else | |
DIR=$* | |
fi | |
explorer.exe $DIR |
View JavaFizzBuzz.java
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
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
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
#!/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
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
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
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
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
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
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) | |
} | |
}; |
NewerOlder