Skip to content

Instantly share code, notes, and snippets.

View mucsher's full-sized avatar

Nguyen Truong Giang mucsher

View GitHub Profile
@mucsher
mucsher / float-liquid-layout.less
Created April 17, 2013 09:06
FLoat Liquid Layout
#floatLiquidLayout() {
.fixedFluid(@fixedWidth, @space, @fixedName: fixed-colum, @fluidName: fluid-colum){
.@{fixedName}{
float: left;
width: @fixedWidth;
}
.@{fluidName} {
margin-left: @fixedWidth + @space;
}
}
@mucsher
mucsher / the-loop.less
Created April 17, 2013 06:30
Loop in Less
@iterations: 30;
// helper class, will never show up in resulting css
// will be called as long the index is above 0
.loopingClass (@index) when (@index > 0) {
// create the actual css selector, example will result in
// .myclass_30, .myclass_28, .... , .myclass_1
(~".myclass_@{index}") {
// your resulting css
@mucsher
mucsher / wp-plugin.php
Created March 29, 2013 04:46
Widget Wordpress Default User
<?php
/*
Plugin Name:
Plugin URI:
Description:
Version: 1.0.0
Author: Mucsher
Author URI:
Text Domain:
Domain Path: /lang
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
</body>
@mucsher
mucsher / use-github
Last active January 1, 2016 16:36
Hướng dẫn sử dụng Github
// 10,Jan,2013
// Hướng dẫn sử dụng Git Bash
//===========================
I. Tạo 1 Repo
Đăng nhập tài khoản của bạn trên github và chọn "Create a Repository" rùi khởi tạo 1 repo mới. sau bước này sẽ chuyển sang 1 tragn hướng dẫn cầu hình ở client
Tại máy client làm như sau:
Chuột phải vào thư mục bất kỳ và chọn "Git Bash Here".
#Create a new repository on the command line
@mucsher
mucsher / bg-opacity.less
Last active December 10, 2015 18:38
Functions Less: Backgroud Opacity Fix ie7
// Background Transparent
@bgOpacity: "../img/bg/opacity/";
#bg-opacity {
.black(@opacity){
background: url(~"@{bgOpacity}black-opacity-@{opacity}.png") repeat 0 0 transprent;
}
.white(@opacity) {
background: url(~"@{bgOpacity}white-opacity-@{opacity}.png") repeat 0 0 transprent;
}
}
@mucsher
mucsher / margin-padding.less
Created January 7, 2013 15:18
Function Less: Margin and Padding Utilities Class
// Define Style Margin - Padding
.marginAndPadding(@iterations)
{
.pd0 {padding: 0px;}
.pdT0{padding-top: 0px;}
.pdR0{padding-right: 0px;}
.pdB0{padding-bottom: 0px;}
.pdL0{padding-left: 0px;}
.mg0 {margin: 0px;}
@mucsher
mucsher / add-font-face.less
Last active December 10, 2015 18:38
Function Less: Add Font-face
@patchFont : "../font/";
#font-face(@fileFont, @nameFont, @svgFontId){
@font-face {
@patch : ~"@{patchFont}@{fileFont}";
font-family: '@{nameFont}';
src: url('@{patch}.eot');
src: url('@{patch}.eot?#iefix') format('embedded-opentype'),
url('@{patch}.woff') format('woff'),
url('@{patch}.ttf') format('truetype'),
url('@{patch}.svg#@{svgFontId}') format('svg');
@mucsher
mucsher / convert-image-size.less
Last active December 10, 2015 18:28
Function Less: Convert Image Size
// Convert Image Size
#imgSize
{
.s3x4(@width) {
width: @width;
height: round((@width / 3) * 4);
}
.s4x3(@width) {
width: @width;
height: round((@width / 4) * 3);