Skip to content

Instantly share code, notes, and snippets.

View sapegin's full-sized avatar
🌄
Disconnected

Artem Sapegin sapegin

🌄
Disconnected
View GitHub Profile
@sapegin
sapegin / jquery.selections.js
Created January 20, 2011 08:06
jQuery Selections ɑ
/**
@title: Selections
@version: 0.0.1
@author: Artem Sapegin
@author: Andreas Lagerkvist
@date: 2011-01-20
@license: http://creativecommons.org/licenses/by/3.0/
@copyright: 2010 Artem Sapegin (sapegin.ru)
@copyright: 2008 Andreas Lagerkvist (andreaslagerkvist.com)
@sapegin
sapegin / gist:811144
Created February 4, 2011 14:08
Windows Speaker
mshta "javascript:close((V=(v=new ActiveXObject('SAPI.SpVoice')).GetVoices()).count&&v.Speak('The quick brown fox jumps over the lazy dog.'))"
@sapegin
sapegin / gist:818396
Created February 9, 2011 12:36
Conditional rows formatting in Google Docs Spreadsheet
var styles = {
'default': {
color: '#000',
background: '#fff',
style: 'normal'
},
sent: {
color: '#ccc',
style: 'italic'
},
@sapegin
sapegin / config.php
Created February 22, 2011 15:41
Microstock FTP Uploader
<?php
$stocks = array (
'shutterstock' => array (
'name' => 'Shutterstock',
'host' => 'ftp.shutterstock.com',
'login' => '',
'password' => '',
'dir' => '/',
@sapegin
sapegin / gist:925002
Created April 18, 2011 08:37
CSS3 Buttons in Springhare
/* Button */
button, input[type="submit"] {
display: inline-block;
padding: 2px 20px;
background: #c4c4c4;
background: -webkit-linear-gradient(top, #eee, #c4c4c4);
background: -moz-linear-gradient(top, #eee, #c4c4c4);
background: -ms-linear-gradient(top, #eee, #c4c4c4);
background: -o-linear-gradient(top, #eee, #c4c4c4);
background: linear-gradient(top, #eee, #c4c4c4);
@sapegin
sapegin / formatnumber.js
Created June 7, 2011 13:27
JavaScript Cookbook
function formatNumber(value) {
value = value.toString()
.replace(".", ",")
.replace(" ", "")
.replace("-", "&minus;");
var re = /(\d+)(\d{3})/;
while (re.test(value)) {
value = value.replace(re, "<i>$1</i>$2");
}
@sapegin
sapegin / FON.BAS
Created June 29, 2011 13:34
Part of our game Iron Man. QBasic, circa 1998
CLS : SCREEN 9
'### BOMBA ###################################################################
CLS : SCREEN 9
DATA 0,0,0,0,0,0,0,4,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,4,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,4,4,4,0,0,0,0,0,0
DATA 0,0,0,0,0,0,4,4,4,0,0,0,0,0,0
DATA 0,0,0,0,0,0,4,4,4,0,0,0,0,0,0
@sapegin
sapegin / birdwatcher.php
Created August 8, 2011 14:31
All categories page for Wordpress
<?php
// wp-content/plugins/birdwatcher/birdwatcher.php
/*
* Страница со списком категорий
*/
add_shortcode( 'all_tags', 'bw_all_tags' );
function bw_all_tags()
{
@sapegin
sapegin / main.js
Created December 6, 2011 11:36
Components initialization
(function() {
initComponents({
pony: function(container) {
}
});
})();
@sapegin
sapegin / jquery.tagfilter.js
Created December 7, 2011 12:51
jQuery Tag Filter
/**
* jQuery Tag Filter
*
* @version 0.1
* @requires jQuery 1.7.1
* @author Artem Sapegin
* @copyright 2011 Artem Sapegin (sapegin.ru)
* @license http://creativecommons.org/licenses/by/3.0/
*/