This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// https://stackoverflow.com/questions/16585502/array-splice-preserving-keys/70576992#70576992 | |
function array_splice_assoc(array &$input, int|string $offset, ?int $length = null, $replacement = []): array | |
{ | |
// Normalize offset | |
$offset = match (true) { | |
is_string($offset) => array_flip(array_keys($input))[$offset] ?? throw new OutOfBoundsException(), | |
$offset < 0 => count($input) + $offset, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0039.cf | |
0039.ga | |
0039.ml | |
00b2bcr51qv59xst2.cf | |
00b2bcr51qv59xst2.ga | |
00b2bcr51qv59xst2.ml | |
02466.cf | |
02466.ga | |
02466.ml | |
07819.cf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name 新 Twitter で「最新のツイート」に強制的に切り替えるやつ | |
// @namespace https://twitter.com/mpyw | |
// @version 0.1 | |
// @description お節介機能を殺す | |
// @author mpyw | |
// @match https://twitter.com/home | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Qiita Trend Eliminator | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2 | |
// @description https://qiita.com/ を https://qiita.com/tag-feed にいい感じに置き換える | |
// @author mpyw | |
// @match https://qiita.com/* | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for group in $(aws logs describe-log-groups | jq -r '.logGroups[].logGroupName'); do | |
echo "Fetching: $group" | |
for stream in $(aws logs describe-log-streams --log-group-name "$group" | jq -r ' | |
.logStreams[] | |
| select(.storedBytes == 0 and ($now|tonumber) - .creationTime / 1000 > 86400) | |
| .logStreamName | |
' --arg now $(date +%s)); do | |
echo "Deleting: $group $stream" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react' | |
import CloudWatchLogs from 'aws-sdk/clients/cloudwatchlogs' | |
import Fingerprint2 from 'fingerprintjs2' | |
import StackTrace from 'stacktrace-js' | |
import { promisify } from 'es6-promisify' | |
export default class Logger { | |
events = [] | |
originalConsole = null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"extends": "standard", | |
"parser": "babel-eslint", | |
"parserOptions": { | |
"sourceType": "module", | |
"allowImportExportEverywhere": false | |
}, | |
"env": { | |
"browser": true, | |
"node": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"extends": "standard", | |
"parser": "babel-eslint", | |
"parserOptions": { | |
"sourceType": "module", | |
"allowImportExportEverywhere": false | |
}, | |
"env": { | |
"browser": true, | |
"node": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require __DIR__ . '/vendor/autoload.php'; | |
use mpyw\Co\Co; | |
use mpyw\Cowitter\Client; | |
const CONSUMER_KEY = '...'; | |
const CONSUMER_SECRET = '...'; | |
const ACESS_TOKEN = '...'; |
NewerOlder