Skip to content

Instantly share code, notes, and snippets.

View daigofuji's full-sized avatar

Daigo Fujiwara daigofuji

View GitHub Profile
@daigofuji
daigofuji / gist:3364434
Created August 15, 2012 22:52
Number format
function number_format (number, decimals, dec_point, thousands_sep) {
// https://raw.github.com/kvz/phpjs/master/functions/strings/number_format.js
// Strip all characters but numerical ones.
number = (number + '').replace(/[^0-9+\-Ee.]/g, '');
var n = !isFinite(+number) ? 0 : +number,
prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,
dec = (typeof dec_point === 'undefined') ? '.' : dec_point,
s = '',
toFixedFix = function (n, prec) {
@daigofuji
daigofuji / Responsive-CSS3-animation.html
Created January 22, 2013 20:35
CSS3 animation simplified. Wanted to deconstruct http://bradfrost.github.com/this-is-responsive/
<!DOCTYPE html>
<html>
<head>
<title>Responsive CSS3 animation. Look! No JavaScript!</title>
<style type="text/css" title="text/css">
<!--
html, body {
margin: 0; padding: 0; height:100%; /* in order for height 100% to work, you need to set html and body to match. then you need to use iframe to add it to the html */
font-family: "Century Gothic", "Tw Cen MT", Futura, "URW Gothic L", Arial, sans-serif;
}
@daigofuji
daigofuji / AutoYear.html
Created March 16, 2013 02:30
Too lazy updating curent year for the copyright at the bottom of the page? So am I.
<p>Copyright &copy; <script type="text/javascript">var d = new Date();document.write(d.getFullYear());</script></p>
@daigofuji
daigofuji / WP custom login
Last active December 18, 2015 08:00
Customizing wordpress "login screen." Add this to wp-content/themes/YOUR_THEME_FOLDER/functions.php
// Custom login page. Modifying logo image, link and title.
function my_custom_login_logo() {
echo '<style type="text/css"> h1 a { background-image:url('.get_stylesheet_directory_uri().'/img/MYLOGO.png) !important; }</style>';
}
add_action('login_head', 'my_custom_login_logo');
function namespace_login_headerurl( $url ) {
$url = get_bloginfo( 'url' );
return $url;
}
@daigofuji
daigofuji / simple-3d-card-flip.html
Last active December 18, 2015 12:28
Simple 3d card flip
<!DOCTYPE html>
<html>
<head>
<title>simple3d</title>
<style type="text/css" title="text/css">
.sandbox-wrap {
-webkit-perspective: 800px;
-moz-perspective: 800px;
-o-perspective: 800px;
perspective: 800px;
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "sass"
images_dir = "img"
javascripts_dir = "js"
fonts_dir = "fonts"
# You can select your preferred output style here (can be overridden via the command line):
output_style = :compact
@daigofuji
daigofuji / .bash_git
Created March 28, 2016 20:50 — forked from MattSurabian/.bash_git
This can be appended to .bash_profile it will allow the prompt to display the current branch and branch-status
if tput setaf 1 &> /dev/null; then
tput sgr0
if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then
MAGENTA=$(tput setaf 9)
ORANGE=$(tput setaf 172)
GREEN=$(tput setaf 190)
PURPLE=$(tput setaf 141)
WHITE=$(tput setaf 256)
else
MAGENTA=$(tput setaf 5)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>change shortname</title>
</head>
<body>
<h1>Disqus y u no work </h1>