Skip to content

Instantly share code, notes, and snippets.

View chitoku-k's full-sized avatar
🐱
Becoming a cat

Chitoku chitoku-k

🐱
Becoming a cat
View GitHub Profile
@hexium310
hexium310 / group-by-range.zsh
Last active June 9, 2021 16:48
group-by-range
group-by-range() {
setopt LOCAL_OPTIONS EXTENDED_GLOB
local value
local values=(${(ps: :)1})
local separator=${2--}
local tmp_separator=,
local result=()
local positives=(${(no)${(M)values:#[[:digit:]]##}})
local negatives=(${(nO)${(M)values:#-[[:digit:]]##}})
@arnars
arnars / Gatsby v2 using Internet Explorer.md
Last active February 15, 2021 08:01
Tips for making Gatsby v2 working with IE / Internet Explorer

Making Gatsby work with Internet Explorer 10 and 11

I created this gist in order to help myself and others keep track of tips and tricks in order to make Gatsby v2 play nicely with Internet Explorer 10 and 11.

This is experience based. Please share your experiences when you have a solution to a problem.

External compilation of modules

If you suspect that an es6-based module is breaking your app, then try to add gatsby-plugin-compile-es6-packages and include the package as one of the modules.

@dmail
dmail / url.js
Last active January 5, 2024 11:09
URL parts naming. Inspired from web browsers API (new URL(), window.location) and rfc3986.
/*
href
┌────────────────────────────────────────┴──────────────────────────────────────────────┐
origin │
┌────────────┴──────────────┐ │
│ authority │
│ ┌───────────────┴───────────────────────────┐ │
│ │ host resource
│ │ ┌──────────┴─────────────────┐ ┌────────────┴───────────┬───────┐
│ │ hostname │ pathname │ │
<?php
$dom = new DOMDocument();
@$dom->loadHTML(file_get_contents('http://user.keio.ac.jp/~rhotta/hellog/'));
$through = (new DOMXPath($dom))->query('//div[@id="links"]//a[@href="2009-06-20-1.html"]');
if ($through->length === 1) {
echo "今日のthrough: {$through[0]->nodeValue}\n";
}
@kb10uy
kb10uy / extreme.cpp
Created February 3, 2016 16:10
とりあえずメモリを埋めたい人用
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#define BLOCK_SIZE 1048576U
uint32_t xor128(void);
int main(void) {
uint32_t count = 0;
@kb10uy
kb10uy / number-ls.sh
Created December 19, 2015 17:43
lsのrwxを8進表示にするシェル関数です
function lsn() {
ls $* --color=always \
| sed -e 's/^-/f/g' \
| sed -e 's/--x/1/g' \
| sed -e 's/-w-/2/g' \
| sed -e 's/-wx/3/g' \
| sed -e 's/r--/4/g' \
| sed -e 's/r-x/5/g' \
| sed -e 's/rw-/6/g' \
| sed -e 's/rwx/7/g' \
@entropiae
entropiae / fix_git_sslread_9806.sh
Last active February 3, 2022 23:32
git: how to solve "SSLRead() return error -9806" in OSX using brew
$ brew remove git
$ brew remove curl
$ brew install openssl
$ brew install --with-openssl curl
$ brew install --with-brewed-curl --with-brewed-openssl git
@0V
0V / 対称定規.cs
Last active October 17, 2015 16:28
OpenCvSharp で対称定規。 依存関係は OpenCvSharp のみ
using System;
using System.Collections.Generic;
using OpenCvSharp.CPlusPlus;
using OpenCvSharp;
namespace OpenCvSharpSomethings
{
class Program
{
static Mat[] rotMat;
@gomasy
gomasy / xvideo.com.zone
Created May 17, 2015 16:00
xvideos not dead
$TTL 120
@ SOA ns1.randomserver.com. webmaster.xvideos.com. (
2015032008
28800
3600
604800
1800 )
NS ns1.randomserver.com.
NS ns2.randomserver.com.
NS ns3.randomserver.com.
@kb10uy
kb10uy / Cocoa.cs
Last active November 8, 2015 16:28
ココアちゃんへの愛を込めた コンパイルはできるけど愛が重すぎるがゆえに実行途中で落ちる 追記:Roslynでコンパイル中にオーバーフローするようになった
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
Func<string> お話 = () => "ごちうさ6羽";
お話().をするお話()
.をするお話().をするお話().をするお話().をするお話().をするお話().をするお話().をするお話().をするお話().をするお話().をするお話().をするお話().をするお話().をするお話().をするお話().をするお話().をするお話()