Skip to content

Instantly share code, notes, and snippets.

tap "hashicorp/tap"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core"
brew "git"
brew "hashicorp/tap/terraform"
cask "1password"
cask "docker"
cask "evernote"
cask "google-chrome"
@1010real
1010real / main.rs
Created September 16, 2022 11:02
first try rust - number 5 game
use std::{io, cmp::Ordering, convert::TryInto};
use rand::Rng;
fn main() {
println!("Guess the number!");
let secret_numbers:[u32; 5] = [
rand::thread_rng().gen_range(0..10),
rand::thread_rng().gen_range(0..10),
rand::thread_rng().gen_range(0..10),
rand::thread_rng().gen_range(0..10),
@1010real
1010real / main.zig
Created August 19, 2022 11:42
first try zig - number 5 game
const std = @import("std");
const time = std.time;
const prng = std.rand.DefaultPrng;
pub fn main() anyerror!void {
const stdin = std.io.getStdIn().reader();
const stdout = std.io.getStdOut().writer();
try stdout.print("Welcome, {s}!\n", .{"5 of Number Game!"});
require "json"
require "selenium-webdriver"
gem "test-unit"
require "test/unit"
class Case1Webdriver < Test::Unit::TestCase
def setup
@driver = Selenium::WebDriver.for :firefox
@base_url = "https://www.google.co.jp/"
require "json"
require "selenium-webdriver"
gem "test-unit"
require "test/unit"
class Case1WebdriverMoto < Test::Unit::TestCase
def setup
@driver = Selenium::WebDriver.for :firefox
@base_url = "https://www.google.co.jp/"
'use strict';
module.exports = function(grunt) {
grunt.registerMultiTask('cclogdelete', 'delete cclog() with ruby script.', function() {
// Merge task-specific and/or target-specific options with these defaults.
var options = this.options({
});
var spawn = require('child_process').spawn;
var cmd = spawn('ruby', ['node_modules/grunt-cclogdelete/cclogdelete.rb', filepath], { cwd:"." });
var buff = "";
// 標準出力を受け取った際の処理(出力される毎にイベント発火)
cmd.stdout.on('data', function(data) {
// grunt.log.writeln('stdout:' + data);
buff += String(data);
});
<html>
テンプレートの予定
</html>
@1010real
1010real / page-index.js
Last active August 29, 2015 14:01
backbone note05
// View of Food
var FoodView = Backbone.View.extend({
tagName:'li',
className:'food',
initialize: function() {
this.render();
this.model.on('change', this.render, this); // 追加
this.model.on('destroy', this.remove, this); // 追加
},
// eventsを追加
@1010real
1010real / page-index.js
Last active August 29, 2015 14:01
backbone note04
// View to add new food interface 追加
var NewView = Backbone.View.extend({
el: $('#newfood'),
initialize: function() {
this.render();
},
events:{
'click button#newfood-button': 'addFood'
},
render: function() {