Skip to content

Instantly share code, notes, and snippets.

@shunirr
shunirr / criminal_jc.md
Last active February 26, 2024 05:51
女子中学生チケット詐欺事件

criminal_jc

@voluntas
voluntas / webrtc.rst
Last active April 30, 2024 14:20
WebRTC コトハジメ
@uiur
uiur / reload.sh
Created April 23, 2015 09:26
Reload chrome extensions using chrome-cli
#!/bin/bash -e
id=$(chrome-cli list links | grep "chrome://extensions/" | awk '{print $1}' | sed -E "s/^\[([0-9]+)\]$/\1/g")
if [[ -n $id ]] ; then
chrome-cli reload -t "$id"
else
chrome-cli open "chrome://extensions"
fi
// ==UserScript==
// @name NumakuroOnGyazoNinjaEditor
// @namespace userjs.pastak.com.gyazo
// @description Gyazo Ninjaの編集機能でヌマクロー画像を使う
// @include https://gyazo.com/*
// ==/UserScript==
(function (callback) {
var script = document.createElement("script");
script.textContent = "$(" + callback.toString() + ");";
document.body.appendChild(script);
var table = document.querySelectorAll('table')[0];
var links = Array.prototype.map.call(table.querySelectorAll('a'), function(a) {return a.href});
var timer = window.setInterval(function() {
document.body.innerHTML = "<img src='"+links[parseInt(Math.random()*links.length)]+"'>";
}, 10000);
var reg = /^\w/y;
reg.exec('xyz'); // => x
reg.exec('xyz'); // => y
reg.exec('xyz'); // => z
reg.exec('xyz'); // => null
reg.exec('xyz'); // => x
reg.lastIndex = 2;
reg.exec('xyz'); // => z

Atomコードリーディングメモ

ビルド方法

script/build

起動したらsrc/window-bootstrap.coffeeが起動時間のログを出してるので、そいつをgrepすると/src/broweser/atom-application.coffee が引っかかる。

src/broweser/atom-application.coffee は、 src/browser/main.coffee に呼ばれている

/*
Copyright © 2014 Hidekazu Kobayashi
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
@tyage
tyage / get.js
Last active December 30, 2015 11:39
Array.prototype.uniq = function() {
var o = {}
, i
, l = this.length
, r = [];
for (i = 0; i < l; i += 1) o[this[i]] = this[i];
for (i in o) r.push(o[i]);
return r;
@johndbritton
johndbritton / decompress.md
Created November 19, 2013 09:35
Explained: Zlib decompress with Perl
decompress="perl -MCompress::Zlib -e 'undef $/; print uncompress(<>)'"
  1. perl - Execute the Perl binary
  2. -MCompress::Zlib - Load the Zlib Perl module
  3. -e '...' - Execute the specified Perl code
  4. undef $/; - Undefine the input record separator to read input to the end
  5. <> - Read from standard input
  6. uncompress(...) - Use uncompress the input using Zlib