Skip to content

Instantly share code, notes, and snippets.

View maechabin's full-sized avatar
:octocat:
Focusing

Takanori Maeda maechabin

:octocat:
Focusing
View GitHub Profile
@maechabin
maechabin / gitコマンド一覧他.md
Last active August 22, 2022 03:02
ドットインストールの内容まとめ

gitコマンド一覧他

--gitの基本--

1. 作業ディレクトリ 2. ステージングエリア(インデックス) 3. リポジトリ(ローカル、リモート)

--コマンド一覧--

@maechabin
maechabin / click_count.html
Last active December 11, 2015 16:08
クリック数をカウント
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>Click Counter</title>
<style>
body {
background-image: linear-gradient(-45deg, #daea6a 25%, #fff 25%, #fff 50%, #daea6a 50%, #daea6a 75%, #fff 75%, #fff);
background-size: 3px 3px;
rvm : rubyのバージョンマネージャー
ruby:
gemset:
rails gem:
-------
xcode
java
新しいRailsプロジェクトを作る
$ rails new myapp
新しいGemをインストールする必要がない場合
※rails new my app --skip-bundle
myappの中に移動
$ cd myapp

#なんだかんだ

##えーと1 どういうこういう そういうどういう

##えーと2 どういうこういう そういうどういう

@maechabin
maechabin / ajaxでファイルをアップロードする方法(php)
Last active August 29, 2015 14:12
ajaxでファイルをアップロードする方法
<?php
/*
if (is_uploaded_file($_FILES["file"]["tmp_name"])) {
if (move_uploaded_file($_FILES["file"]["tmp_name"], "csv/" . $_FILES["file"]["name"])) {
chmod("csv/" . $_FILES["file"]["name"], 0644);
}
@maechabin
maechabin / get_param_val.php
Last active August 29, 2015 14:15
WordPress URLの任意のパラメータから値を取得するショートコード
// URLの任意のパラメータから値を取得
function get_param_val($atts) {
extract(shortcode_atts(array(
"name" => ""
), $atts));
$val = (isset($_GET[$name]) && $_GET[$name] != "") ? $_GET[$name] : "";
$val = htmlspecialchars($val, ENT_QUOTES);
/////////////////////////////////
//TOPへ戻るボタン
/////////////////////////////////
jQuery(function(){
jQuery(window).scroll(function(){
//最上部から現在位置までの距離を取得して、変数[now]に格納
var now = jQuery(window).scrollTop();
//最上部から現在位置までの距離(now)が600以上
if(now > 600){
//[#page-top]をゆっくりフェードインする
@maechabin
maechabin / Get_file_name.php
Last active August 29, 2015 14:15
指定フォルダから任意のファイル名を取得
<?php
class Get_file_name {
private $dir;
private $pattern;
public $match_word;
function __construct($d, $p) {
$this->dir = $d;