Skip to content

Instantly share code, notes, and snippets.

@ozinepank
ozinepank / dabblet.css
Created October 10, 2012 10:20 — forked from daneden/dabblet.css
CSS Photo Album
/* CSS Photo Album */
/* Rebound of this shot by @daryl: http://drbl.in/fwwM */
* {
margin: 0;
padding: 0;
position: relative;
box-sizing: border-box;
}
@ozinepank
ozinepank / gist:4090802
Created November 16, 2012 20:49 — forked from hileon/gist:1311735
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Windows)

General

Ctrl+KB toggle side bar
Ctrl+Shift+P command prompt
Ctrl+` python console
Ctrl+N new file

Editing

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

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

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

##clone

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

<?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>';
img.grayscale.disabled {
filter: url("data:image/svg+xml;utf8,&lt;svg xmlns=\'http://www.w3.org/2000/svg\'&gt;&lt;filter id=\'grayscale\'&gt;&lt;feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/&gt;&lt;/filter&gt;&lt;/svg&gt;#grayscale");
-webkit-filter: grayscale(0%);
}
@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;
@ozinepank
ozinepank / Animations.css
Created April 1, 2013 02:39
Cross-Browser Animations animations that works across Firefox, Chrome, Opera, and IE10
.polling_message {
color:white;
float:left;
margin-right:2%;
}
.view_port {
background-color:black;
height:25px;
width:100%;
/* Smartphones (portrait and landscape) ----------- */
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
}
/* Smartphones (landscape) ----------- */
@media only screen
and (min-width : 321px) {
@ozinepank
ozinepank / resizewindow.js
Last active December 15, 2015 18:58
$(window).resize(function()
calSize();
$(window).resize(function() {
calSize();
});
function calSize(){
var head_height = $("#title-product").height();
$("aside").css("top",head_height+20);
if ( $(window).width() < 768) {
$("aside").css("top",0);
}
@ozinepank
ozinepank / dropdown.html
Created April 5, 2013 02:54
Bootstrap Dropdown
<div style="z-index: 5;" class="topbar-wrapper">
<div data-dropdown="dropdown" class="topbar">
<div class="topbar-inner">
<div class="container">
<h3><a href="#">Project Name</a></h3>
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>