Skip to content

Instantly share code, notes, and snippets.

View siriokun's full-sized avatar
All Included (AI) scope of work

Rio Purnomo siriokun

All Included (AI) scope of work
View GitHub Profile
@siriokun
siriokun / css-link.js
Last active August 29, 2015 14:01 — forked from replete/gist:2436076
a[href^="http://"] {
/* fully valid URL, likely external link */
}
a[href="http://google.com"] {
/* link to specific website */
}
a[href^="/"], a[href^=".."] {
/* internal relative link */
<ul id="slidecontrols">
<li><a href="#one">One</li>
<li><a href="#two">Two</li>
</ul>
<div id="slides">
<div>This is content block One</div>
<div>This is content block Two</div>
</div>
<?php
function showalltags() {
$tags = get_tags();
$html;
foreach ($tags as $tag){
$tag_link = get_tag_link($tag->term_id);
$html .= "<a href='{$tag_link}' title='{$tag->name} Tag' class='{$tag->slug}'>";
@siriokun
siriokun / minimal-ui-safari.html
Created January 12, 2014 16:12
Minimal UI in Safari. Minimize top and bottom bar in Safari.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="minimal-ui">
<title>Minimal UI in Safari</title>
</head>
<body>
<h1>Minimal UI in Safari</h1>
<p>Minimize top and bottom bar in Safari.</p>
.blur {
filter: url(/images/blur.svg#blur);
-webkit-filter: blur(10px);
-moz-filter: blur(10px);
-ms-filter: blur(10px);
filter: blur(10px);
}
@siriokun
siriokun / append.js
Created August 28, 2013 17:34
Append Javascript to head tag in HTML, so it not blocking rendering.
(function(){
var yourscript = document.createElement('script');
yourscript.type = 'text/javascript';
yourscript.async = true;
yourscript.src = 'http://domain.tld/path/to.js';
(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(yourscript);
})();
/**
* Toggle
*/
body{
background: #111;
}
.container{
background: #fff;
margin:0 auto;
@siriokun
siriokun / spin.css
Created July 31, 2013 10:38
Spin Animation in CSS3
.gear {
position: absolute;
width: 60px;
height: 60px;
background: url("/images/gear.png") no-repeat;
background-size: 100% 100%;
z-index: 2;
-webkit-animation-name: gearSpin;
-moz-animation-name: gearSpin;
-ms-animation-name: gearSpin;
@siriokun
siriokun / fixed-nav.js
Created July 26, 2013 08:24
Fixed Navigation on oscon.com/oscon2013
var headerHeight;
// is navigation visible? See #en_header with height 150px, so when scroll down more than 150px, we make the #nav_borders position fixed.
$(function() {
headerHeight = $('#en_header').height() + 1;
$(window).on('scroll', fixNav);
});
// if not visible, then make it fixed
function fixNav() {
if ($(window).scrollTop() >= headerHeight) {