This file contains hidden or 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
using System; | |
public class SeedRandom | |
{ | |
private UnityEngine.Random.State _randomState; | |
public static int DefaultSeed() | |
{ | |
return (int)System.DateTime.Now.Ticks; | |
} |
This file contains hidden or 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
using System; | |
namespace MyNamespace | |
{ | |
/// holds an either succeeded or failed result | |
// need latest C# version to use <out T, out E> instead | |
public interface Result<T, E> where E : Exception | |
{ | |
public bool OK { get; } |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Cysharp.Threading.Tasks; | |
using UnityEngine; | |
using UnityEngine.Networking; |
This file contains hidden or 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
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
gem 'rspec', '~> 3.0' | |
end |
This file contains hidden or 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 URL = 'https://example.com'; | |
const CELL = 'A1' | |
const MAIL_TO = '[email protected]'; | |
// Create a trigger to run `main` periodically | |
function main() { | |
const sheet = SpreadsheetApp.getActiveSheet(); | |
const lastDate = readLastDate(sheet); | |
const today = Utilities.formatDate(new Date(), 'UTC', 'yyyy-MM-dd'); | |
if (lastDate === null || lastDate == today) { |
This file contains hidden or 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
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
gem "rails", "6.0.0" |
This file contains hidden or 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
[dependencies] | |
log = { version = "0.4", features = [ "std" ] } |
This file contains hidden or 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
+run_workflow: | |
http_call>: http://$(ip):8000/http_call_dig | |
retry: false | |
_retry: 2 |
This file contains hidden or 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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"os" | |
"regexp" |
This file contains hidden or 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
module Rstruct | |
def self.new(*attributes) | |
names = caller.map do |stack| | |
# ".../hoge.rb:7:in `<module:Hoge>'" | |
if (m = stack.match(/\A.+in `<(module|class):(.+)>.+/)) | |
m[2] | |
end | |
end.reject(&:nil?) | |
file_name, line_num = caller[0].split(':') | |
line_executed = File.readlines(file_name)[line_num.to_i - 1] |
NewerOlder