Skip to content

Instantly share code, notes, and snippets.

@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active March 27, 2024 06:36
A badass list of frontend development resources I collected over time.
@ozinepank
ozinepank / fixhoveriOS.js
Created April 6, 2013 10:12
Fixing the Hover event on the iPad/iPhone/iPod
//ipad and iphone fix
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) {
$(".menu li a").click(function(){
//we just need to attach a click event listener to provoke iPhone/iPod/iPad's hover event
//strange
});
}
// credit article : http://blog.0100.tv/2010/05/fixing-the-hover-event-on-the-ipadiphoneipod/
@ozinepank
ozinepank / detection_user_agent.js
Last active December 15, 2015 15:09
Detect User agent
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
$(".body-section").addClass("app-visible");
/* | เมื่อ user เปิดเว็บผ่าน iPhone/iPod ให้ addClass .app-visible เข้าไปใน body-section | */
// credit : http://davidwalsh.name/detect-iphone
IS_IPAD = navigator.userAgent.match(/iPad/i) != null;
IS_IPHONE = (navigator.userAgent.match(/iPhone/i) != null) || (navigator.userAgent.match(/iPod/i) != null);
IS_android = navigator.userAgent.match(/Android/i) != null;
@wpsmith
wpsmith / wps_add_ie_html5_shim.php
Created July 22, 2012 02:57
Add IE conditional html5 shim to header
<?php
add_action( 'wp_head', 'wps_add_ie_html5_shim' );
/**
* Add IE conditional html5 shim to header
*/
function wps_add_ie_html5_shim() {
global $is_IE;
if ( $is_IE ) {
echo '<!--[if lt IE 9]>';
echo '<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>';
@norsez
norsez / การใช้ Git ฉบับรีบร้อน.md
Created June 29, 2012 09:19
การใช้ Git ฉบับรีบร้อน #THiOS

#การใช้ Git ฉบับรีบร้อน

##Git Git เป็น revision control แบบ distributed (หมายความว่าไม่มีศูนย์กลาง) และ แบบ non-linear history (หมายความว่ามีประวัติการเปลี่ยนแปลงแบบไม่ใช่เส้นตรง) ดังนั้นทำให้คอนเซปต์ของ Git นั้นต่างจาก revision control รุ่นก่อนหน้าหลายอย่าง

ต่อไปจะอธิบายย่อๆเรื่องคำสั่ง Git โดยอิงกับการทำงานใน GitHub เป็นสำคัญ (Git มีวิธีใช้พลิกแพลงมากมาย ไปศีกษาการใช้อื่นได้ด้วยการไป Google เอาเอง)

##clone

สมมุติว่ามี repository แห่งนีงใน GitHub เช่น https://github.com/norsez/projectA

@amaudy
amaudy / gist:2871051
Created June 4, 2012 21:50
How I learn English.
ภาษาเป็นเรื่องของ "ทักษะ" ครับ
และทักษะมันเป็นเรื่องที่ฝึกกันได้ :)
อารมณ์เดียวกับฝึกเขียนโปรแกรมนั่นแหละ
ทีนี้คำถามคือ แล้วจะฝึกอย่างไร?
พี่ขอแชร์ประสบการณ์การฝึกภาษาของพี่ให้ฟังนะครับ (จริงๆ อ่าน)
เมื่อก่อนความสามารถเรื่องภาษาอังกฤษของผมก็เหมือนคนไทยทั่วๆ ไป ที่เรียนภาษาอังกฤษกันตั้งหลายปี แต่พูดสื่อสารกับชาวต่างชาติไม่ได้ (แต่สื่อสารด้วยวิธีอ่าน/เขียนพอได้)
จุดเปลี่ยนของผมเริ่มต้นเมื่อประมาณ 3-4 ปีที่แล้ว ตอนไปงานบาร์แคมป์กรุงเทพ ครั้งที่ 2
ได้เจอผู้คนเยอะแยะมากมาย รวมถึงฝรั่งที่กระตือรือร้นพร้อมจะแชร์เทคนิคการเขียนโปรแกรม เทคนิคการทำธุรกิจให้ฟัง
ตอนนั้นก็ฟังไม่รู้เรื่องหรอก แต่ดีตรงที่ว่าในงานมีคนไทยที่เก่งภาษาเป็นคนช่วยแปลให้

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

<?php
// <!DOCTYPE html>
echo $view->doctype('HTML5');
// <meta charset="UTF-8">
echo $view->headMeta()->setCharset('UTF-8');