Skip to content

Instantly share code, notes, and snippets.

View mrtuanphong's full-sized avatar

Phong Do mrtuanphong

View GitHub Profile
@mrtuanphong
mrtuanphong / README.md
Created May 6, 2022 06:33 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@mrtuanphong
mrtuanphong / readme.md
Last active February 25, 2020 18:41
Mac OS X - "Live Server" for Website Development

Installation

You need node.js and npm. You should probably install this globally.

npm install -g live-server

Usage

Go to your project folder and type live-server to start.

@mrtuanphong
mrtuanphong / snippet.js
Created February 25, 2020 18:22
How to load all the images from a folder into web page using Jquery (https://stackoverflow.com/a/18480589)
var dir = "assets/images/";
var fileextension = ".png";
$.ajax({
//This will retrieve the contents of the folder if the folder is configured as 'browsable'
url: dir,
success: function (data) {
//List all .png file names in the page
$(data).find("a:contains(" + fileextension + ")").each(function () {
var filename = this.href.replace(window.location.host, "").replace("http://", "");
$("body").append("<img src='" + dir + filename + "' alt=''>");
@mrtuanphong
mrtuanphong / browserhacks.md
Last active February 25, 2020 18:16
Browserhacks is an extensive list of browser specific CSS and JavaScript hacks from all over the interwebs.
@mrtuanphong
mrtuanphong / html5-jquery-template.html
Last active February 25, 2020 19:17
Blank HTML5 with jQuery Boilerplate
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Blank HTML5</title>
<link href="https://fonts.googleapis.com/css?family=Roboto:400,500&display=swap" rel="stylesheet">
<!--<link href="style.css" rel="stylesheet">-->
<style>
@mrtuanphong
mrtuanphong / BEM css state naming.md
Last active February 25, 2020 18:39
BEM Naming Convention

is-, has-: Signify that the piece of UI in question is currently styled a certain way because of a state or condition. This stateful namespace is gorgeous and comes from SMACSS.

It tells us that the DOM currently has a temporary, optional, or short-lived style applied to it due to a certain state being invoked.

Vietnamese:

is-, has-: Biểu thị rằng phần UI đang được đề cập hiện đang được tạo kiểu theo một cách nhất định vì trạng thái hoặc điều kiện. Không gian tên trạng thái này là tuyệt đẹp và đến từ SMACSS.

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

@mrtuanphong
mrtuanphong / bootstrap-breakpoints.scss
Last active February 25, 2020 18:40 — forked from webinfinita/bootstrap-breakpoints.sass
Variables for responsive design in bootstrap with sass
@mixin breakpoint($point){
@if ($point == lg){
@media (min-width: 1200px){ @content }
}
@else if ($point == md){
@media (min-width: 992px) and (max-width: 1199px){ @content }
}
@else if ($point == sm){
@mrtuanphong
mrtuanphong / gist:222e169bffd7e332ea2331cd36ee627b
Last active February 25, 2020 18:36 — forked from stuart11n/gist:9628955
Rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote