Skip to content

Instantly share code, notes, and snippets.

View iamntz's full-sized avatar
🐛
Coding Stuff

Ionuț Staicu iamntz

🐛
Coding Stuff
View GitHub Profile
@iamntz
iamntz / ntzInfiniteCarousel.js
Created June 17, 2011 13:15
ntz infinite carousel
(function( $ ){
$.fn.ntz_infiniteCarousel = function() {
return this.each(function(){
var carousel = $(this),
etalon = $('li:first', carousel);
carousel.wrap('<div class="ntz_infiniteCarouselWrap"></div>');
var w = carousel.closest('.ntz_infiniteCarouselWrap'), //the wrap
n = $('<a href="#" class="nav prev"/><a href="#" class="nav next"/>'), // the navigation
@iamntz
iamntz / gist:1129043
Created August 6, 2011 05:26
jquery request animation frame example
if ( t() && jQuery.timers.push(t) && !timerId ) {
// Use requestAnimationFrame instead of setInterval if available
if ( requestAnimationFrame ) {
timerId = true;
raf = function() {
// When timerId gets set to null at any point, this stops
if ( timerId ) {
requestAnimationFrame( raf );
fx.tick();
}
<table>
<tr>
<td class="calendar-heading" colspan="7">
<table>
<tr>
<td class="calendar-prev"><a href="#">« Prev</a></td>
<td class="calendar-month">August 2011</td>
<td class="calendar-next"><a href="#">Next »</a></td>
</tr>
</table>
<table>
<thead>
<tr>
<td colspan="7">
<table>
<tr>
<td class="calendar-prev"><a href="#">« Prev</a></td>
<th>August 2011</td>
<td class="calendar-next"><a href="#">Next »</a></td>
</tr>
@iamntz
iamntz / StefanZWrapBox
Created August 29, 2011 09:24 — forked from anonymous/StefanZWrapBox
Wrap box for my current project
$('.borderedBox, #content').each(function() {
var t = $(this),
mainClasses = this.className,
mainIds = this.id,
idAttr = ( mainIds ? ' id="' + mainIds + '"' : '' ),
classAttr = ( mainClasses ? ' class="' + mainClasses + '"' : '' );
t.wrap('<div ' + idAttr + classAttr + ' / >');
t.removeAttr('class').removeAttr('id');
});
#############################################################
###
### Auto update titlu pagina (jQuery, PHP) (php)
### http://scripts.ddumi.com/2011-09-02/php-code/105.html
### http://blog.ddumi.com/diverse/2011/09/02/auto-update-titlu-pagina-jquery-php.html
###
#############################################################
<script type="text/javascript">
$(document).ready(function() {
{
"scope": "source.css",
"completions":
[
{ "trigger": "l|left", "contents": "left:$1;$0" },
{ "trigger": "r|right", "contents": "right:$1;$0" },
{ "trigger": "t|top", "contents": "top:$1;$0" },
{ "trigger": "b|bottom", "contents": "bottom:$1;$0" },
{ "trigger": "z|z-index", "contents": "z-index:$1;$0" },
$ntz_site_url = 'http://domain.com/';
define( 'WP_SITEURL', $ntz_site_url );
define( 'WP_HOME', $ntz_site_url );
define( 'WP_CONTENT_URL', $ntz_site_url.'/wp-content' );
define( 'WP_PLUGIN_URL', $ntz_site_url.'/wp-content/plugins' );
@iamntz
iamntz / gist:1958038
Created March 2, 2012 12:07
ing greasemonkey script
// ==UserScript==
// @name ing
// @namespace ing.ro
// @include https://www.homebank.ro/*
// @include http://www.homebank.ro/*
// ==/UserScript==
var ING_USER = 'xxxxxxxxxx';