Skip to content

Instantly share code, notes, and snippets.

Avatar
🐱
meow!

sters sters

🐱
meow!
View GitHub Profile
View 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|
View gist:521e2be8b3aeed0c87fe75f7335f259e
package bench
import (
"strings"
"testing"
)
func recursiveFindKeyStack(searchKey string, recursiveMap map[string]interface{}) []interface{} {
targets := []map[string]interface{}{
recursiveMap,
View gist:18b106cceb94d9b31cdc5489222f6919
(()=>{let t='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!"#$%&()-=^~\\|@`[{]};+:*,<.>/?_'.split(""),l="";for(let e=0;e<16;e++)l+=t[~~(Math.random()*t.length)];alert(l)})();
View gist:dde1904f7e244f20750646ffc9fb5294
{
"animation_enabled": false,
"auto_indent": true,
"auto_match_enabled": true,
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
View docker-prune-data.sh
docker image prune -f && docker volume prune -f && docker network prune -f
View scraping_kit.txt
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 Sep 6, 2017
Confirm the validity of migration and definition in Laravel x PHPUnit.
View MigrationsTest.php
<?php
namespace Tests;
use Tests\TestCase;
class MigrationsTest extends TestCase
{
/**
* Check table columns. MySQL only.
*
@sters
sters / hoge.js
Created Apr 19, 2017
クリップボードにコピーするブックマークレット(要babel+babili)
View hoge.js
(() => {
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 Jan 25, 2017
安い!!お得!!激安JS!!
View gekiyasu.js
//==================================================//
// 参考
// http://qiita.com/shiozaki/items/0e42e101b7483df13c8f
//
// 使い方
// <span class="gekiyasu">19800</span>
// <script src="gekiyasu.js"></script>
// <script>
// gekiyasu.initialize();
// </script>
View image_optimization.py
# 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
You can’t perform that action at this time.