Skip to content

Instantly share code, notes, and snippets.

View tiborsaas's full-sized avatar
🛰️
29C4D3B40280AE810FB4A81681E4417B

Tibor Szász tiborsaas

🛰️
29C4D3B40280AE810FB4A81681E4417B
View GitHub Profile
@tiborsaas
tiborsaas / gist:9155823
Created February 22, 2014 14:39
Search for a specific query string in a URL
var id = $('<a>').attr('href', keyword )[0].search.substr(1).split('&').map( function( el ){
var tmp = el.split('=');
if(tmp[0] == 'v'){
return tmp[1]
}
})[0];
@tiborsaas
tiborsaas / gist:9415342
Last active August 29, 2015 13:57
Simple countdown function
// MM DD YYYY, HH:SS
var target_date = new Date("03-07-2014, 19:00").getTime();
var days, hours, minutes, seconds;
var countdown = document.getElementById("time");
setInterval(function () {
var current_date = new Date().getTime();
var seconds_left = (target_date - current_date) / 1000;
days = parseInt(seconds_left / 86400);
@tiborsaas
tiborsaas / gist:9545599
Last active August 29, 2015 13:57
CSS only Lightbox
/* http://schier.co/post/creating-pure-css-lightboxes-with-the-:target-selector */
/*
<a href="#taddam">See stuff in the layer</a>
<div id="taddam" class="lightbox">
<div class="box-content"> Bla bla... </div>
<a href="#close" class="box-close">CLOSE</a>
</div>
*/
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="89.734px" height="90.8px" viewBox="0 0 89.734 90.8" enable-background="new 0 0 89.734 90.8" xml:space="preserve">
<style>
path { fill:#09f }
</style>
<path d="M89.735,4.03c0.01-1.213-0.531-2.365-1.473-3.131s-2.178-1.064-3.363-0.812L32.292,11.331
c-1.834,0.392-3.149,2.005-3.164,3.881l-0.362,47.11c-2.932-1.744-6.48-2.783-10.313-2.813l-0.17-0.002
@tiborsaas
tiborsaas / gist:9937dd83a51597a88108
Last active August 29, 2015 14:20
Dynamic Backbone models
define([
'backbone',
'models/export/YouTubeExport',
'models/export/ImgurExport'
], function (
Backbone,
YouTubeExport,
ImgurExport
) {
'use strict';
<snippet>
<!-- put this file in /packages/User/<Folder Name>/console_log.sublime-snippet then restart your Sublime Text 2 -->
<content><![CDATA[console.log($1);$0]]></content>
<tabTrigger>con</tabTrigger>
<scope>text.html,source.js</scope>
<description>console.log()</description>
</snippet>
<snippet>
<!-- put this in another file /packages/User/<Folder Name>/console_dir.sublime-snippet then restart your Sublime Text 2 -->
@tiborsaas
tiborsaas / RackExtension exporter
Last active August 29, 2015 14:23
Export RackExtension list
// PRESS (CTRL/Command)+SHIFT+J and paste this code after you loaded all the extensions
var saveHTML = function(fileName, html){
var link = document.createElement("a");
link.download = fileName;
link.href = "data:text/html,"+html;
link.click();
};
var links = document.querySelectorAll('#browse h2');
@tiborsaas
tiborsaas / like_gate.php
Created December 7, 2011 12:59
Facebook like gate
<?php
/********************************************************
* Usage:
* - include this file in any document
* - use the following PHP tags to show / hide content:
*
* <?php if( LIKED ): ?>
* Welcome my friend
* <?php else: ?>
@tiborsaas
tiborsaas / dabblet.css
Created February 12, 2012 18:58
Just fucking around with CSS3
/**
* Just fucking around with CSS3
*/
html {
background: linear-gradient( 73deg, #fff, #999 );
min-height: 100%;
}
@keyframes bg{
0% { background: #eee; text-indent: 10% }
@tiborsaas
tiborsaas / dabblet.css
Created March 7, 2012 10:58
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
html{
background: #f06;
background: linear-gradient(90deg, #ccc, #fff);
min-height:100%;
}
.tooltip{