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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
open(FILE, 'index.php') or die "$!"; | |
while (my $line = <FILE>) { | |
unless ($line =~ /[^(\s|\t|\n)]/g) { | |
$line =~ s/(\s|\t|\n)//g; | |
} | |
print $line; |
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 | |
$your_birthday = '';//type your birthday here e.g.:'2013/05/11' | |
$today = new DateTime(); | |
$birthday = new DateTime($your_birthday); | |
$interval = $today->diff($birthday, true); | |
echo $interval->format('your birthday is %m months and %d days ahead'); |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> | |
<style> | |
h1, | |
h2, | |
h3, | |
h4, |
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
#!/usr/bin/env perl | |
use v5.12; | |
use warnings; | |
print 'Enter a string: '; | |
my $str = <STDIN>; | |
print 'Enter a number of times: '; | |
chomp(my $num = <STDIN>); | |
print $str x $num; |
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/sh | |
# @see https://github.com/hatena/Git-for-Designers | |
# @see http://blog.asial.co.jp/845 | |
read -p "user name: " name | |
git config --global user.name "`echo $name`" | |
read -p "user email: " email | |
git config --global user.email "`echo $email`" |
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
update | |
upgrade | |
install coreutils |
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
CREATE TABLE posts( | |
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, | |
title VARCHAR(256) NOT NULL, | |
body TEXT NOT NULL, | |
created_at DATETIME NOT NULL, | |
updated_at DATETIME NOT NULL | |
); | |
INSERT INTO posts( | |
title, body, created_at, updated_at |
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
apt-get update | |
apt-get upgrade -y |
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 | |
// @see http://weblanguagestudy.hatenablog.com/entry/2014/07/08/013412 | |
// 受け取った値を変数へ格納 | |
$nensu = $_POST['nensu']; | |
$seikatsuhi = $_POST['nenkan_seikatsuhi']; | |
$fuyo_shishutsu = $_POST['fuyo_shishutsu']; | |
$hitsuyo_shishutsu = $_POST['hitsuyo_shishutsu']; | |
$izoku_nenkin = $_POST['izoku_nenkin']; |
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 | |
$before_ext = '.wma'; | |
$after_ext = '.mp3'; | |
$bitrate = 192; | |
$ffmpeg = '/usr/bin/env ffmpeg'; | |
$pattern = '*' . $before_ext; | |
$files = glob($pattern); | |
foreach ($files as $file) { |
OlderNewer