Skip to content

Instantly share code, notes, and snippets.

View miya0001's full-sized avatar

Takayuki Miyauchi miya0001

View GitHub Profile
@miya0001
miya0001 / gist:c24ddc69ad8871e76dbe
Created June 20, 2014 16:40
この感じがなんか変。笑
<?php
add_post_meta( 100, "sub_title", "Hello World!" );
add_post_meta( 100, "sub_title", "Good Morning!" );
update_post_meta( 100, "sub_title", "Bye" );
/*
array(2) {
[0]=>
@miya0001
miya0001 / index.js
Created September 8, 2014 18:03
sphero-sensor
var Cylon = require('cylon');
Cylon.robot({
connection: [
{ name: 'sphero', adaptor: 'sphero', port: '/dev/cu.Sphero-PRO-AMP-SPP' }
],
device: [
{ name: 'sphero', driver: 'sphero' }
],
@miya0001
miya0001 / setuser.sh
Last active August 29, 2015 14:06
amimotoのnginxまわりのユーザーとかをごにょごにょ
#!/usr/bin/env bash
set -ex
service monit stop
sed -i -e "s/^user .*;$/user ec2-user ec2-user;/" /etc/nginx/nginx.conf
sed -i -e "s/^listen.owner .*$/listen.owner = ec2-user/" /etc/php-fpm.d/www.conf
sed -i -e "s/^listen.group .*$/listen.group = ec2-user/" /etc/php-fpm.d/www.conf
sed -i -e "s/nginx:nginx/ec2-user:ec2-user/g" /etc/monit.d/php-fpm
add_action( 'admin_footer', function(){
echo <<EOL
<script type="text/javascript">
$('bigger-link').click(function () {
$('.mceContentBody *').css('font-size', $(this).attr('data-fontsize'));
});
</script>
EOL;
#!/usr/bin/env bash
set -ex
mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.bak
echo "server {
listen 80;
server_name _;
return 301 https://\$host\$request_uri;
}" > /etc/nginx/conf.d/default.conf
<?php
class Example_Test extends WP_UnitTestCase {
/**
* @test
* @runInSeparateProcess
* @preserveGlobalState disabled
*/
public function test_post_condition()
@miya0001
miya0001 / gist:5e8662410c974898b2be
Last active August 29, 2015 14:10
theme-review guideline
  • License
    • style.css
      • License
      • License URI
    • Bundled
      • fonts
      • icons
      • images
      • javascripts
  • css
#!/usr/env/bin bash
set -ex
rm -f /etc/ssh/ssh_host_*
cd /var/log
find /var/log/ -type f -name '*.log' -exec cp /dev/null {} \;
cp /dev/null /var/log/syslog
yes | cp /dev/null /home/vagrant/.ssh/authorized_keys
#!/usr/bin/env bash
dir=`pwd`
vccw_cwd=''
while [ '/' != $dir ]
do
parent=`dirname $dir`
dir=$parent
if [ -e $dir/.vccw/machines/default/virtualbox/id ]; then
@miya0001
miya0001 / gist:fdc361b5de4e56ad8109
Last active August 29, 2015 14:11
wp-tests-install
#!/usr/bin/env bash
set -ex;
echo 'DROP DATABASE IF EXISTS wordpress_test;' | mysql -u root
rm -fr /tmp/wordpress
rm -fr /tmp/wordpress-tests-lib
bash $(wp --info --format=json | jq -r '.wp_cli_dir_path')/templates/install-wp-tests.sh wordpress_test root '' localhost latest;