Skip to content

Instantly share code, notes, and snippets.

View fliedonion's full-sized avatar

Takahiro KITAHARA fliedonion

View GitHub Profile
@fliedonion
fliedonion / CheckJavaVersion.cs
Last active July 7, 2017 14:24
Get Java version of specified directory.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text.RegularExpressions;
namespace CheckJavaVersion {
class Program {
static void Main(string[] args) {
@fliedonion
fliedonion / TaskCompletionSourceBasic.cs
Created September 20, 2016 23:41
TaskCompletionSource example.
class Program {
static Task<byte[]> FromWebClient(WebClient wc, Uri address) {
var tcs = new TaskCompletionSource<byte[]>();
wc.DownloadDataCompleted += (object sender, DownloadDataCompletedEventArgs e) => {
if (e.Cancelled)
tcs.SetCanceled();
else if (e.Error != null)
tcs.SetException(e.Error);
@fliedonion
fliedonion / ballAndDialog.js
Last active August 13, 2016 20:17
HTML-CANVAS: use canvas image in dialog sample.
function drawBalls(){
// 描画しているだけ
var BALL = 4, R = 4, W=100, H=100;
var canvas = document.querySelector("#canvas");
var ctx = canvas.getContext("2d");
canvas.addEventListener("contextmenu", function(e){e.preventDefault(); clear();});
ctx.globalCompositeOperation = "source-over";
for(var i = 0; i < BALL; i++){
@fliedonion
fliedonion / Form1.cs
Last active July 21, 2016 14:59
C# Post With Binary Value Sample
using System;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Windows.Forms;
namespace PostDataWithFlask {
public partial class Form1 : Form {
public Form1() {
@fliedonion
fliedonion / angular-compile.js
Created October 30, 2015 02:56
angular compile usage
var app = angular.module('app',[]);
app.directive('compileBold', function($compile){
return{
restrict: 'E',
link: function(scope, element, attr){
console.log(element.html());
element.html('<b>bold text</b>');
$compile(element.contents())(scope);
}
@fliedonion
fliedonion / babel_mocha_immutablejs.html
Last active October 16, 2015 10:19
mocha, babel, Immutable.js
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="bower_components/mocha/mocha.css"/>
<script src="bower_components/mocha/mocha.js"></script>
<script src="node_modules/babel-core/browser.js"></script>
<script src="bower_components/chai/chai.js"></script>
<script src="bower_components/lodash/lodash.js"></script>
@fliedonion
fliedonion / !Shebang bat - summary.md
Last active October 9, 2015 10:48
allow you to write script in windows bat file

this is currently experimental

Summary Shabang.bat allow you to embed your script in bat file. Only put #!.bat.
You can write single script file and #!.bat doesn't create any filein your %temp% to run script
Env Windows and ( node.js or python or ... )
@fliedonion
fliedonion / !GIST file list order - summary.md
Last active April 26, 2024 08:11
Understand GIST file list order.
Summary How to control (or Understand) your GIST page's files list order.
Notice not official documentation.
@fliedonion
fliedonion / !Find string in PATH env var - summary.md
Last active October 9, 2015 03:34
Find in Path environment variables with babel-node
Summary Find the path from PATH env vars which includes string you specified.
Env win babel-node
@fliedonion
fliedonion / !jQuery $ajax sample - summary.md
Last active October 9, 2015 03:36
jQuery-$ajax-sample
Summary jQuery $ajax sample or snippet
Env jQuery