Skip to content

Instantly share code, notes, and snippets.

View torounit's full-sized avatar

Hiroshi Urabe torounit

View GitHub Profile
@torounit
torounit / route53.py
Created March 17, 2018 03:42 — forked from rmarchei/route53.py
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:
@torounit
torounit / getCookie.js
Created December 28, 2017 18:59
get cookie used headless chrome.
const Chromy = require('chromy')
const fs = require('fs')
let chromy = new Chromy()
async function main () {
chromy.chain()
.goto('https://example.com/login.php')
.type('#username', 'username')
.type('#password', 'password')
@torounit
torounit / basic.json
Created December 28, 2017 18:55
Basic auth for backstopJS and Chromy
{
"username" : "foo",
"password" : "bar",
}
@torounit
torounit / option_blog_public_on_front_page.php
Created December 22, 2017 07:34
WordPressでTOPページのみ、公開したい場合のハック。
<?php
add_filter( 'option_blog_public', function( $value ) {
if ( is_front_page() ) {
return 1;
}
return $value;
});
@torounit
torounit / slider-customizer.js
Last active October 3, 2017 21:21
Slider support customizer.
/**
* File customizer.js.
*
* Theme Customizer enhancements for a better user experience.
*
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
*/
( function( $ ) {
<?php
namespace Torounit\WP;
/**
* Class Post_Type_Permalink_Expander
*
* Expand permalink and rewrite setting.
*
* @package Torounit\WP
@torounit
torounit / functions.php
Created February 2, 2017 11:25
vk-post-author-display fix
<?php
remove_filter( 'the_content', 'pad_add_author');
add_filter( 'q_profile', 'pad_add_author');
@torounit
torounit / site.yml
Created January 29, 2017 18:40
VCCW setting for HelpHub.
# encoding: utf-8
# vim: ft=ruby expandtab shiftwidth=2 tabstop=2
#
# Network Settings
#
hostname: helphub.dev
ip: 192.168.77.10
#
<?php
add_filter('CPTP_set_rewrite_module' , new CPTP_Module_Rewrite_Fix() );
/**
*
* Add Rewrite Rules
*
* @package Custom_Post_Type_Permalinks
* @version 1.0.3
<!doctype html>
<html lang="ja">
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<title>Document</title>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url');?>">
<?php wp_head();?>
</head>
<body>
<?php if(have_posts()):?>