Skip to content

Instantly share code, notes, and snippets.

@taichi
taichi / code_reading.md
Last active April 10, 2024 13:04
太一のコードの読み方メモ

太一のコードの読み方メモ

全体として太一が感覚的に実践している事を論理的に説明しようと試みている為、
説明の粒度が適切でなかったり一貫性が無いように見える部分があるかもしれない。
普段やっているけども書ききれていない事も多分きっとある。

コードを読むとは何か

  • コードを嗜む
  • コードを学ぶ
  • 武器を手に入れる
@minodisk
minodisk / detect_attachment_id.php
Created September 4, 2012 03:58 — forked from fumikito/detect_attachment_id.php
WordPressで画像のURLからアタッチメントIDを取得する
<?php
/**
* 画像のURLのサイズ違いのURLを取得する
*
* @param string $url 画像のURL
* @param string $size 画像のサイズ (thumbnail, medium, large or full)
*/
function get_attachment_image_src($url, $size) {
$image = wp_get_attachment_image_src(get_attachment_id($url), $size);
@violetyk
violetyk / gist:5343883
Last active August 4, 2020 05:11
スクロールイベント 上下方向の判定
var start_pos = 0;
$(window).scroll(function(e){
var current_pos = $(this).scrollTop();
if (current_pos > start_pos) {
console.log('down');
} else {
console.log('up');
}
start_pos = current_pos;
});
@adamstac
adamstac / gist:7462202
Last active March 27, 2025 11:27
Install and configure Sendmail on Ubuntu

Install and configure Sendmail on Ubuntu

This should help you get Sendmail installed with basic configuration on Ubuntu.

  1. If sendmail isn't installed, install it: sudo apt-get install sendmail
  2. Configure /etc/hosts file: nano /etc/hosts
  3. Make sure the line looks like this: 127.0.0.1 localhost yourhostname
  4. Run Sendmail's config and answer 'Y' to everything: sudo sendmailconfig
  5. Restart apache sudo service apache2 restart
@neilgee
neilgee / markup.php
Last active January 31, 2021 15:56
WordPress Media Uploader For Multiple Images
<?php
/* One of the upload fields as an example */
?>
<tr>
<th><label for="ols_user_meta_image_1"><?php _e( 'OLS Image 1', 'textdomain' ); ?></label></th>
<td>
<!-- Outputs the image after save -->
<img src="<?php echo esc_url( get_the_author_meta( 'ols_user_meta_image_1', $user->ID ) ); ?>" style="width:150px;"><br />
<!-- Outputs the text field and displays the URL of the image retrieved by the media uploader -->
.clearfix:before {
display: table;
content: " ";
}
.clearfix:after {
display: table;
content: " ";
clear: both;
}

Workflow

CheckList after coding.

  1. Submit Google spread sheet for the project for QC(Quality Control).
    1. Add page title to header <title> tag for SEO.
    2. If sub page, Did you add sub page name to <title>?
    3. Did you add text to Alt attribute on img tag? (You need to add text to alt)
    4. Did you add link & anchor link to href attr?
    5. Check h1,h2,h3 ... number order. should not skip number. Check with developer tool bar "document outline".
  2. Fix Errors
  3. Remove unuse 404 error(js, css, imgs). Check console on Google Chrome for it.
@sola-msr
sola-msr / file0.txt
Created June 19, 2018 01:28
【Vagrant】vagrant upするとエラーが発生するようになったので修正しました、という軌跡 ref: https://qiita.com/sola-msr/items/b36b647a12511098daac
>vagrant up