Skip to content

Instantly share code, notes, and snippets.

@kimuchi1203
kimuchi1203 / max3.py
Created November 13, 2015 16:12
Answer the maximum among the three 0-9
import numpy as np
from chainer import optimizers, FunctionSet, Variable
import chainer.functions as F
import random
import copy
model = FunctionSet(
l1 = F.Linear(30, 10)
)
optimizer = optimizers.Adam()
@kimuchi1203
kimuchi1203 / log_tabs.js
Last active March 18, 2020 16:56
chrome extension to log tabs user watched.
var tabToUrl = {};
chrome.tabs.onCreated.addListener(
function(tab) {
console.log("create "+tab.url);
}
);
chrome.tabs.onUpdated.addListener(
function(tabId, changeInfo, tab) {
public class UrlImageView extends ImageView {
private static final String LOG_TAG = "View";
private Map<String, Bitmap> bitmapStore;
private String url;
public UrlImageView(Context context) {
super(context);
bitmapStore = new HashMap<String, Bitmap>();
@kimuchi1203
kimuchi1203 / gist:3762423
Created September 21, 2012 16:18
(bookmarklet) hide 'RT by' expression in twitter.com
javascript:(function(){setTimeout(function(e){e=document.getElementsByTagName('span');for(var i=e.length-1;i>=0;--i){if(e[i].getAttribute('class')=='with-icn'){e[i].style.visibility='hidden';e[i].style.position='absolute';}}}, 100);})();
@kimuchi1203
kimuchi1203 / gist:2941790
Created June 16, 2012 16:05
(bookmarklet) play YouTube related video automatically
javascript:(function(p,r){p=yt.getConfig('PLAYER_REFERENCE');var i=-1;r=function(s){if(s==0){p.loadVideoById((function(){var b=document.getElementById('watch-related').getElementsByTagName('button');if(++i>0){b[i-1].parentNode.parentNode.style.backgroundColor='transparent';}i=i%b.length;b[i].parentNode.parentNode.style.backgroundColor='#ffff00';return b[i%b.length].getAttribute('data-video-ids');})());}};p.addEventListener('onStateChange',r);try{document.getElementById('watch-headline-user-info').innerHTML+='[play_related]'}catch(e){}})();
@kimuchi1203
kimuchi1203 / myplayer.html
Created June 16, 2012 10:13
play YouTube related video automatically.
<html>
<head>
<script type="text/javascript" src="../js/swfobject.js"></script>
<script type="text/javascript" src="../js/myplayer.js"></script>
</head>
<body>
<input type="textarea" onkeypress="pressEnter(event.keyCode, this.value);"></input>
<div id="myplayer"></div>
<script type="text/javascript">
<!--