Skip to content

Instantly share code, notes, and snippets.

View fliedonion's full-sized avatar

Takahiro KITAHARA fliedonion

View GitHub Profile
@fliedonion
fliedonion / install.md
Last active December 14, 2016 17:28
install bat for gogs with nssm

install gogs with nssm.

summary

usage:
gogs-nssm-installer.bat <your-machine-name> <ip-of-your-machine> <port-for-gogs-web>

ex) gogs-nssm-installer.bat mywin8 192.168.0.10 5050

important notice: If use none secure location, use loopback ip (like 127.0.1.1) for gogs and use gogs behind other web server (nginx, apache etc).

@fliedonion
fliedonion / FpSpread_InDirectCell.cs
Created December 6, 2016 17:15
FarPoint Spread, "INDIRECTCELL" custom function similar with Excel "INDIRECT".
using System.Windows.Forms;
using FarPoint.CalcEngine;
using FarPoint.Win.Spread.Model;
namespace WindowsFormsApplication1 {
public partial class Form1 : Form {
// this is only behind code.
// put Spread in form designer.
// run and edit A1 cell. values appear in D3, D4 and E3 cells.
@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 20, 2025 11:29
Understand GIST file list order.
Summary How to control (or Understand) your GIST page's files list order.
Notice not official documentation.