Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
</body>
</html>
@roine
roine / query.sql
Created August 6, 2013 06:47
wp replace localhost by live domain
UPDATE `wp_posts` SET `guid` = REPLACE( `guid` , 'localhost', 'liveserver' )
@roine
roine / header.php
Last active December 20, 2015 09:58
prerender and prefetch in wp
<?php if(is_front_page()): ?>
// do not use prefecth on homepage
<?php elseif (is_singular()): ?>
// load the next post, view http://ideasandpixels.com/get-only-url-of-next-and-previous-posts-wordpress
<link rel="prefetch" href="<?php echo get_permalink(get_adjacent_post(false,'',true)); ?>">
<link rel="prerender" href="<?php echo get_permalink(get_adjacent_post(false,'',true)); ?>">
<?php else: ?>
<link rel="prefetch" href="<?php echo home_url(); ?>">
<link rel="prerender" href="<?php echo home_url(); ?>">
<?php endif; ?>
@roine
roine / config.js
Created July 23, 2013 07:46
meteor accounts config
Accounts.loginServiceConfiguration.remove({service: "github"});
Accounts.loginServiceConfiguration.remove({service: "facebook"});
Accounts.loginServiceConfiguration.remove({service: "twitter"});
Accounts.loginServiceConfiguration.remove({service: "linkedin"});
Accounts.loginServiceConfiguration.insert({
service: "github",
clientId: "ID",
secret: "SECRET"
});
@roine
roine / app.scss
Created July 4, 2013 04:30
scss loading order
@import "style_bootstrap"; // twitter bootstrap or zurb foundation
@import "settings"; // contains the variables
@import "helpers" // contains all the reusable classes
@import "styles" // contains the general style could be split into small files (ie: 'header', 'content', 'column_left', 'footer', 'page1')
@import "tweaks" // your shame
@roine
roine / main.js
Created July 3, 2013 06:01
Simply hide label if placeholder is supported
var hasPlaceholder = function(){
return 'placeholder' in document.createElement('input');
}
if(hasPlaceholder()){
$('form label').hide();
}
@roine
roine / index.html
Last active December 18, 2015 22:39
marquee style without gap
<ul class="slideContainer" id="money_start">
<li class="slideItem" >
EUR
</li>
<li class="slideItem">
USD
</li>
<li class="slideItem">
JPY
</li>
@roine
roine / colors.scss
Last active December 18, 2015 06:59
cool colors
// http://api.colourco.de/export/png/%23cdb6e7%2C%23bedae9%2C%23c0df9f%2C%23ddca98%2C%23e8baba
purple
#cdb6e7
rgb(205, 182, 231)
hsl(268, 50%, 81%)
hcl(309, 28%, 77%)
lab(77, 17, -21)
blue
@roine
roine / isArray.js
Created May 31, 2013 09:59
find out if array
function is_array(variable){
return Object.prototype.toString.call( variable ) === '[object Array]'
}
@roine
roine / find_and_replace_by.php
Last active December 17, 2015 12:38
Basic find and replace in all the tables from a secific database. I use this script for my wordpress deployment.
<?php
/*
* find_and_replace_by takes 4 optional arguments
* first is the host
* second is db username
* third is db password
* fourth is database name
* ie: $ find_and_replace_by.php root password drupal
* or with two arguments: