Skip to content

Instantly share code, notes, and snippets.

蒼時弦や elct9620

Block or report user

Report or block elct9620

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View downloader.rb
require 'csv'
require 'json'
require 'open-uri'
class Downloader
SCRIPT_URL = 'SCRIPT_URL'
attr_reader :uri
def initialize
@elct9620
elct9620 / twnic_frozen.rb
Created Nov 26, 2019
TWNIC 凍結域名偵測
View twnic_frozen.rb
# frozen_string_literal: true
require 'net/http'
require 'date'
require 'optparse'
require 'json'
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
@elct9620
elct9620 / v2.rb
Last active Nov 16, 2019
Thread Pool 實作的簡易 Worker
View v2.rb
# frozen_string_literal: true
module Task
# The task executor
#
# @api private
class Worker
# @param manager [Task::Manager] the work belongs to
# @param tasks [Queue] the tasks to execute
#
@elct9620
elct9620 / README.md
Last active Jul 5, 2019
CloudFlare Workers Status API
View README.md

CloudFlare Workers as Status API

In most case, the CloudFlare SLA is greater than our server. So, we can use it as a simple uptime checker.

Usage

  1. Deploy index.js to your CloudFlare Workers, and bind KV which you save the status.
  2. Add updater.rb to your server, and setup cron job to run it
  3. Get node status on any static page with https://your-worker.workers.dev/?node[]=name to fetch node status
@elct9620
elct9620 / Microsoft.PowerShell_profile.ps1
Last active Jun 14, 2019
Compile environment for mruby on Windows 10
View Microsoft.PowerShell_profile.ps1
$vsWhere = 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe'
$vsInstallPath = &($vsWhere) -latest -property installationPath
if ($vsInstallPath -and (test-path "$vsInstallPath\Common7\Tools\vsdevcmd.bat")) {
& "${env:COMSPEC}" /s /c "`"$vsInstallPath\Common7\Tools\vsdevcmd.bat`" -no_logo && set" | foreach-object {
$name, $value = $_ -split '=', 2
set-content env:\"$name" $value
}
}
@elct9620
elct9620 / prepend_socket.rb
Created Mar 18, 2019
Golang's io.TeeReader in Ruby implement use prepend
View prepend_socket.rb
# frozen_string_literal: true
require 'socket'
# :nodoc:
module TeeReader
attr_reader :buffer
def initialize(*args)
super
View fiber-http-enumerable.rb
# frozen_string_literal: true
require 'net/http'
require 'fiber'
require 'socket'
require 'openssl'
require 'benchmark/ips'
require 'benchmark/memory'
View async-http-fiber.rb
# frozen_string_literal: true
require 'net/http'
require 'fiber'
require 'uri'
require 'openssl'
require 'socket'
require 'pp'
require 'benchmark/ips'
View singleton.cs
using UnityEngine;
public class GameInstance {
// Core Game Module
private Player.Controller _playerController;
public Player.Controller PlayerController {
retrun _playerController;
}
public GameInstance() {
View async-http.rb
require 'net/http'
require 'uri'
require 'socket'
require 'openssl'
require 'fiber'
require 'benchmark'
require 'benchmark/ips'
require 'benchmark/memory'
# :nodoc:
You can’t perform that action at this time.