Skip to content

Instantly share code, notes, and snippets.

View torounit's full-sized avatar

Hiroshi Urabe torounit

View GitHub Profile
@shimakyohsuke
shimakyohsuke / init.sh
Last active March 3, 2017 07:44
Wocker でコンテナ立ち上げ後に実効するやつ
#!/bin/bash
#shopt -s expand_aliases
#source ~/.bash_profile
## 日本語化する?
echo "日本語化する? [Y/N]"
read ANSWER
case $ANSWER in
"" | "Y" | "y" | "yes" | "Yes" | "YES" )
@fumikito
fumikito / login.php
Last active March 23, 2016 15:21
勝手にログイン
<?php
# ID1でログインする
include __DIR__.'/wp-load.php';
wp_set_auth_cookie(1);
header( 'Location: '.admin_url() );
exit;
<?php
function test($init, $key = 'a')
{
$var = $init;
$var[$key] = 1;
echo var_export($init, true), ': ', is_array($var) ? 1 : 0, "\n";
}
test(null); // OK
@rmarchei
rmarchei / route53.py
Last active June 16, 2022 04:11
route53 hook for dehydrated - python2 / python3 + boto2 version. Tested on Ubuntu 16.04
#!/usr/bin/env python
# How to use:
#
# Ubuntu 16.04: apt install -y python-boto OR apt install -y python3-boto
#
# Specify the default profile on aws/boto profile files or use the optional AWS_PROFILE env var:
# AWS_PROFILE=example ./dehydrated -c -d example.com -t dns-01 -k /etc/dehydrated/hooks/route53.py
#
# Manually specify hosted zone:
@hissy
hissy / HOWTOUSE.md
Created January 31, 2017 16:18
[WordPress] Extended WP_Query implements Iterator
<?php
$args = ['post_type' => 'post'];
foreach((new Iterative_WP_Query($args)) as $post_id => $post) {
	echo get_the_title($post_id);
}
@tanshio
tanshio / search-page.php
Last active August 31, 2017 14:18
20170624
<?php
/*
Template Name: インクリメンタルサーチページ
*/
?>
<?php get_header(); ?>
<h1>インクリメンタルサーチ</h1>
@teppeis
teppeis / es-class-fields.md
Last active March 13, 2022 13:57
ES Class Fieldsのプライベートフィールドがハッシュな変態記法なのは何でなんだぜ?

ES Class Fields (Stage 2 now)

プライベートフィールドがハッシュな変態記法なのは何でなんだぜ?

class Point {
    #x;
    #y;
 constructor(x = 0, y = 0) {

Time Travel Debugging

Time Travel refers to the ability to record a tab and later replay it ([WebReplay][wrr]). The technology is useful for local development, where you might want to:

  • pause and step forwards or backwards
  • pause and rewind to a prior state
  • rewind to the time a console message was logged
  • rewind to the time an element had a certain style or layout
  • rewind to the time a network asset loaded
@maepon
maepon / zoomup201810.md
Last active October 11, 2018 13:54
#2 WP ZoomUP 前川昌幸『2018年のフロントエンドのトレンドから見るコーディング事情』
@joshangell
joshangell / PhpStorm-and-Gridsome.md
Last active December 21, 2022 10:13
Quick and dirty explanation of how to get autocomplete, syntax highlighting etc when using Gridsome in PhpStorm.

PhpStorm

  1. Make sure your gridsome dev server is running: cd frontend and then yarn dev or npm run dev
  2. Install JS GraphQL plugin: https://jimkyndemeyer.github.io/js-graphql-intellij-plugin/
  3. Select everything inside <page-query>, click the light bulb icon, choose "Inject language or reference" and select GraphQL, like this:

NOTE: you only have to do this once and then all your .vue files will support GraphQL queries inside <page-query> tags.