- Open below directory in Finder with Cmnd + Shift + G
/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/
<?php | |
/** | |
* 아래는 참고한 자료. | |
* @link https://stackoverflow.com/questions/24651869/regex-matching-links-without-a-tag/24653720?stw=2#24653720 | |
*/ | |
function make_link_clickable($text) | |
{ | |
return preg_replace( | |
'!<a(.|\n)*?</a>(*SKIP)(*F)|' //skip a tag | |
. '(((f|ht)tp(s)?://)[-a-zA-Zа-яА-Я()0-9@:%_+.~#?&;/=]+)!i', |
$fileName = 'Billing-Summary.csv'; | |
header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); | |
header('Content-Description: File Transfer'); | |
header("Content-type: text/csv"); | |
header("Content-Disposition: attachment; filename={$fileName}"); | |
header("Expires: 0"); | |
header("Pragma: public"); | |
$fh = @fopen( 'php://output', 'w' ); |
<?php | |
function batch_convert_encoding($dir, $out_charset = 'utf-8'){ | |
if($handle = opendir($dir)){ | |
echo "\n\n## Directory is $dir\n\n"; | |
while(false !== ($file = readdir($handle))){ | |
if(in_array($file, array('.', '..', '.git'))){ | |
continue; | |
} | |
$file_path = realpath($dir . DIRECTORY_SEPARATOR . $file); | |
$pathinfo = pathinfo($file_path); |
I posted several talks about compiling PHP from source, but everyone was trying to convince me that a package manager like Homebrew was a more convenient way to install.
The purpose of Homebrew is simple: a package manager for macOS that will allow you to set up and install common packages easily and allows you to update frequently using simple commands.
I used a clean installation of macOS Sierra to ensure all steps could be recorded and tested. In most cases you already have done work on your Mac, so chances are you can skip a few steps in this tutorial.
I’ve made this according to the installation instructions given on GetGrav.
<?php | |
// This script convert short open tag to long open tag. | |
// Inspired from https://stackoverflow.com/a/3621669 | |
// | |
// Source: https://gist.github.com/mytory/5380b6a970ed4c14e16dd1be498e0919 | |
// Usage: php short-open-tag-converter.php target_file_path.php | |
// Notice: This script change original file. | |
// | |
// If you want to change '<?=' to '<?php echo ' uncomment line 45~50. |
FROM ubuntu:18.04 | |
ENV DEBIAN_FRONTEND=noninteractive | |
# repository | |
RUN sed -i 's|archive.ubuntu.com|mirror.kakao.com|g' /etc/apt/sources.list | |
RUN apt-get update | |
RUN apt-get upgrade -y | |
# timezone |
var attachment_id = 1234; | |
var attachment = new wp.media.model.Attachment.get(attachment_id); | |
attachment.fetch({success:function(att){ | |
if (_.contains(['png','jpg','gif','jpeg'],att.get('subtype'))) { | |
console.log(att.attributes); | |
$("<img/>").attr("src",att.attributes.sizes.thumbnail.url).appendTo($("body")); | |
} | |
}}); |
(function () { | |
"use strict"; | |
// 스매싱 매거진의 '지연된 웹폰트 불러오기' javascript를 안형우가 수정한 것. | |
// https://gist.github.com/hdragomir/8f00ce2581795fd7b1b7 | |
// 한 번 캐시하면 css 파일은 클라이언트 측에 저장한다. | |
// 아래 css_href 가 바뀌면 그 때 다시 받는다. | |
// woff base64를 내장한 css | |
var css_href = 'css/webfont.woff.css'; | |
// localStorage 를 지원하지 않는 브라우저를 위한 css |
<?php | |
/** | |
* Author: An, Hyeong-woo | |
* Email: mytory@gmail.com | |
* Blog: http://mytory.net | |
* Description: See detail on help message. You can see by running this script without args. | |
* Dependencies: Tidy extension. | |
*/ | |
function cmd_echo($str){ | |
echo $str . PHP_EOL; |