Skip to content

Instantly share code, notes, and snippets.

View sters's full-sized avatar
🐱
meow!

sters sters

🐱
meow!
View GitHub Profile
javascript:Array.prototype.map.apply(document.querySelectorAll("#search h3"), [(x) => { const e = x.parentElement; if (e.tagName !== "A") return null; return e.href; }]).filter((x) => x !== null).forEach((u, i) => setTimeout(() => window.open(u), i * 50));
@sters
sters / rst_server.rb
Created February 3, 2020 14:32
rst_server.rb
require "socket"
gs = TCPServer.open(20000)
addr = gs.addr
addr.shift
printf("server is on %s\n", addr.join(":"))
while true
Thread.start(gs.accept) do |s|
package bench
import (
"strings"
"testing"
)
func recursiveFindKeyStack(searchKey string, recursiveMap map[string]interface{}) []interface{} {
targets := []map[string]interface{}{
recursiveMap,
@sters
sters / gist:18b106cceb94d9b31cdc5489222f6919
Created April 21, 2018 10:25
password create bookmarklet
(()=>{let t='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!"#$%&()-=^~\\|@`[{]};+:*,<.>/?_'.split(""),l="";for(let e=0;e<16;e++)l+=t[~~(Math.random()*t.length)];alert(l)})();
docker image prune -f && docker volume prune -f && docker network prune -f
@sters
sters / scraping_kit.txt
Created December 5, 2017 03:21
easy scraping kit
class Console
{
public static $resultFile = '';
public static function init()
{
preg_match('@^(.+?)\.php@', __FILE__, $matches);
static::$resultFile = __DIR__ . '/result_' . basename($matches[1]) . '.csv';
}
@sters
sters / MigrationsTest.php
Created September 6, 2017 05:04
Confirm the validity of migration and definition in Laravel x PHPUnit.
<?php
namespace Tests;
use Tests\TestCase;
class MigrationsTest extends TestCase
{
/**
* Check table columns. MySQL only.
*
@sters
sters / hoge.js
Created April 19, 2017 02:56
クリップボードにコピーするブックマークレット(要babel+babili)
(() => {
let w = window, d = document, db = d.body;
let format = () => {
return "[" + d.title + "](" + d.URL + ")";
};
if (w.__z0 !== undefined) {
w.__z0.onClick({currentTarget: w.__z0d});
return;
}
@sters
sters / gekiyasu.js
Last active January 25, 2017 11:37
✨安い!!お得!!激安JS!!✨
//==================================================//
// 参考
// http://qiita.com/shiozaki/items/0e42e101b7483df13c8f
//
// 使い方
// <span class="gekiyasu">19800</span>
// <script src="gekiyasu.js"></script>
// <script>
// gekiyasu.initialize();
// </script>
# In[1]:
get_ipython().magic(u'matplotlib inline')
from matplotlib import pyplot as plt
from __future__ import division, print_function, absolute_import
import pandas as pd
import numpy as np
import time as t