Skip to content

Instantly share code, notes, and snippets.

View tokoro10g's full-sized avatar
😼

Tokoro tokoro10g

😼
View GitHub Profile
// ==UserScript==
// @include http://bgm.tokor.org/*
// ==/UserScript==
(function(){
var PersistentStore = {
read: function(key){
return JSON.parse(window.localStorage.getItem(key));
},
write: function(key,val){
/*!
* quantize.js Copyright 2008 Nick Rabinowitz.
* Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
*/
// fill out a couple protovis dependencies
/*!
* Block below copied from Protovis: http://mbostock.github.com/protovis/
* Copyright 2010 Stanford Visualization Group
* Licensed under the BSD License: http://www.opensource.org/licenses/bsd-license.php

galileo-makefile

A simple Makefile template to cross-compile C programs for Intel Galileo.
(Sorry, for Linux only, for now.)

Before You Begin

  1. First, you have to download Galileo Arduino IDE from Intel website.
    Drivers | Intel Communities
    https://communities.intel.com/docs/DOC-22226
@tokoro10g
tokoro10g / file0.txt
Created March 8, 2015 09:26
mikutterコンソールから特定のユーザのフォロワーを一括ブロック ref: http://qiita.com/tokoro10g/items/b2c2f8c8375a460d608c
Service.primary.followers(screen_name: "ユーザ名").next { |users|
users.each { |user|
(Service.primary.twitter/:blocks/:create).json(screen_name: user.idname)
# puts "blocked: " + user.idname
}
}
@tokoro10g
tokoro10g / PKGBUILD
Last active April 10, 2017 09:49
PKGBUILD_gcc-arm-none-eabi-bin-4.8_2014_q3-1
# Original Maintainer: James Duley <jagduley gmail>
pkgname=gcc-arm-none-eabi-bin
pkgver=4.8_2014_q3
_pkgname=gcc-arm-none-eabi
_pkgver=${pkgver//_/-}-update
_pkgvershort=${_pkgver%-*}
_pkgvershort=${_pkgvershort/-q/q}
_pkgdate=20140805
pkgrel=1
pkgdesc="GNU Tools ARM Embedded Processors (binary distribution, includes GDB and newlib)"
@tokoro10g
tokoro10g / img2maze.m
Last active May 15, 2019 08:12
NTFウェブサイトの迷路シートの画像から迷路データを抽出するMATLABスクリプト
clear
close all
filename = 'MM2017HX_pre.png';
url = ['http://www.ntf.or.jp/mouse/micromouse2017/' filename];
if ~exist(filename, 'file')
websave(filename,url);
end
IM = imread(filename);
@tokoro10g
tokoro10g / saizeriyacp.m
Last active June 17, 2019 04:02
サイゼリヤ1000円以内でカロリー最大化 MATLABバージョン
clear
load saizeriyadb.mat
maxtotalprice = 1000;
selection = optimvar('selection', saizeriyadb.name, 'Type', 'integer', 'LowerBound', 0, 'UpperBound', 1);
problem = optimproblem('ObjectiveSense', 'maximize', 'Objective', dot(selection, saizeriyadb.calorie));
problem.Constraints.constr = dot(selection, saizeriyadb.price) / maxtotalprice <= 1;
@tokoro10g
tokoro10g / stalinsort.m
Created August 5, 2019 06:04
スターリンソートMATLABバージョン
clear
data = [1 2 2 1 1 4 3 9];
data(data<cummax(data))=[]
% -> [1 2 2 4 9]

IQが1なので書き忘れた上に書こうと思っていた内容を完全に忘れてしまいました

[Trace - 06:10:12 PM] Sending request 'initialize - (1)'.
Params: {
"processId": 78866,
"rootPath": "/opt/test",
"clientInfo": {
"name": "vscode",
"version": "1.41.1"
},
"rootUri": "file:///opt/test",
"capabilities": {