Skip to content

Instantly share code, notes, and snippets.

View peace098beat's full-sized avatar

Tomoyuki Nohara peace098beat

View GitHub Profile
@peace098beat
peace098beat / post.php
Created October 8, 2014 14:39
ファイルアップロードPHP | 動画、静止画に対応
<?php
/**********************************************************
/ アップロードファイルの保存
/**********************************************************/
if( $data = $_FILES["photo"] ){
move_uploaded_file( $data["tmp_name"], "./img/".date(U).$data["name"] );
// move_uploaded_file( $data["tmp_name"], "./img/".$data["name"] );
// echo("<img src='"."./img/".date(U).$data["name"]."' alt=''>");
}else{
// echo "nono";
@peace098beat
peace098beat / char-utf8.php
Created October 8, 2014 14:40
PHP文字コードの明記
// 文字コードの設定
header("Content-Type: text/html; charset=UTF-8");
@peace098beat
peace098beat / favicon-common.html
Created October 9, 2014 01:12
ふぃふぃ工房のファビコンの共通設定
<link rel="shortcut icon" type="image/x-icon" href="https://daks2k3a4ib2z.cloudfront.net/536b73942a0858ec6a980642/5370b2e27435bb8d42e7a96c_favicon.ico">
<link rel="apple-touch-icon" href="https://daks2k3a4ib2z.cloudfront.net/536b73942a0858ec6a980642/5370b17ab0eab33e05d34879_icon_256x256.jpg">
@peace098beat
peace098beat / webfont.css
Created October 9, 2014 01:29
無料日本語ウェブフォント | JapanSans
// Webfont Japanese
// http://webfontfan.com/japansans/?p=20
@font-face {
font-family: 'JapanSans80';
src: url('http://webfontfan.com/fontcss/font/JapanSans80.eot');
src: url('http://webfontfan.com/fontcss/font/JapanSans80.eot?#iefix') format('embedded-opentype'),
url('http://webfontfan.com/fontcss/font/JapanSans80.woff') format('woff'),
url('http://webfontfan.com/fontcss/font/JapanSans80.ttf') format('truetype');
font-weight: normal;
font-style: normal;
@peace098beat
peace098beat / add_data.php
Created October 9, 2014 06:39
PHP | MySQLへの初期接続関数
// データの追加
function add_data($conn, $title, $URLmain, $URLsub1, $URLsub2, $memo, $dt) {
global $TBNAME;
$id = 99999999999;
$sql = "INSERT INTO ".$TBNAME. "(title, URLmain, URLsub1, URLsub2, memo, dt)
VALUES
(:title, :URLmain, :URLsub1, :URLsub2, :memo, :dt)";
$stmt = $conn->prepare($sql);
$stmt->bindParam(":title", $title);
@peace098beat
peace098beat / Zebra_Image.php
Created October 9, 2014 14:16
PHPで画像のトリミング
require("./Zebra_Image.php");
function resizeImage($source){
$image = new Zebra_Image();
$image->source_path = $source;
echo $image->target_path;
$width = 490;
$hight = 100; //490*(9/16);
@peace098beat
peace098beat / debug.php
Created October 9, 2014 14:53
htmlのデバッグ用要素 | PHPデバッグ
<style type="text/css">
#debugs{
visibility:hidden;
width: 200px;
font-size: 10px;
position:absolute;
left:5px;
top:50px;
z-index: 5;
}
@peace098beat
peace098beat / php.ini
Last active August 29, 2015 14:07
php.ini ファイルアップロードの制限を変更
;http://unsolublesugar.com/20120623/134957/
memory_limit = 50M ;スクリプトが確保できる最大メモリ(バイト単位)
post_max_size = 40M ;POSTデータに許可される最大サイズ(バイト単位)
upload_max_filesize = 30M ;アップロードできるファイルの最大サイズ(バイト単位)
max_input_time = 60 ;スクリプトが入力をパースする最大時間(秒単位)
@peace098beat
peace098beat / index.html
Created October 18, 2014 03:11
SNS アイコン | bootstrap-social
https://github.com/peace098beat/bootstrap-social
<link href=".***/css/bootstrap.css" rel="stylesheet">
<link href=".***/css/font-awesome.css" rel="stylesheet">
<link href=".***/css/docs.css" rel="stylesheet" >
<link href=".***/bootstrap-social.css" rel="stylesheet" >
@peace098beat
peace098beat / ae_ui.jsx
Created October 22, 2014 05:03
[AE] UIパネル
function createUI(thisObj) {
var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "C:。ミ くコ:彡 C:。ミ",[100, 100, 400, 300]);
Tex1 = myPanel.add("edittext", [30,30, 270,50,], "数字を入れてね");
Tex2= myPanel.add("edittext", [30,60, 270,80], "");
Btn = myPanel.add ("button" , [30,90, 270,110],"Click!");
Stc= myPanel.add ("statictext" , [20,120,290,140],"");
Stc .visible=false;
return myPanel;
}
myToolsPanel = createUI(this);