Skip to content

Instantly share code, notes, and snippets.

// SmoothScroll v0.9.9
// Licensed under the terms of the MIT license.
// People involved
// - Balazs Galambosi: maintainer (CHANGELOG.txt)
// - Patrick Brunner (patrickb1991@gmail.com)
// - Michael Herf: ssc_pulse Algorithm
SmoothScroll = (function() {
function ssc_init(){if(!document.body)return;var e=document.body;var t=document.documentElement;var n=window.innerHeight;var r=e.scrollHeight;ssc_root=document.compatMode.indexOf("CSS")>=0?t:e;ssc_activeElement=e;ssc_initdone=true;if(top!=self){ssc_frame=true}else if(r>n&&(e.offsetHeight<=n||t.offsetHeight<=n)){ssc_root.style.height="auto";if(ssc_root.offsetHeight<=n){var i=document.createElement("div");i.style.clear="both";e.appendChild(i)}}if(!ssc_fixedback){e.style.backgroundAttachment="scroll";t.style.backgroundAttachment="scroll"}if(ssc_keyboardsupport){ssc_addEvent("keydown",ssc_keydown)}}function ssc_scrollArray(e,t,n,r){r||(r=1e3);ssc_directionCheck(t,n);ssc_que.push({x:t,y:n,lastX:t<0?.99:-.99,lastY:n<0?.99:-.99,start:+(new Date)});if(ssc_pending)
@Parziphal
Parziphal / TagHelper.php
Created August 11, 2014 20:27
Show tag types in tag lists
<?php
class TagHelper extends Rails\ActionView\Helper
{
public function tag_link($name, array $options = array())
{
!$name && $name = 'UNKNOWN';
$prefix = isset($options['prefix']) ? $options['prefix'] : '';
$obsolete = isset($options['obsolete']) ? $options['obsolete'] : array();
$tag_type = Tag::type_name($name);
@Parziphal
Parziphal / 105_to106_db_update.php
Created June 5, 2014 15:44
MyImouto 105 to 106 standalone database update script
<?php
require __DIR__ . '/config/boot.php';
$queries = [
"ALTER TABLE `table_data` CHANGE `name` `name` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL",
"UPDATE `table_data` SET `name` = 'non-explicit-posts' WHERE `table_data`.`name` = 'non-explici' LIMIT 1",
# Post tag histories table
"CREATE TABLE `post_tag_histories` (
`id` int(11) NOT NULL AUTO_INCREMENT,