Skip to content

Instantly share code, notes, and snippets.

@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);
@realmyst
realmyst / gist:1262561
Created October 4, 2011 19:34
Склонение числительных в javascript
function declOfNum(number, titles) {
cases = [2, 0, 1, 1, 1, 2];
return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ];
}
use:
declOfNum(count, ['найдена', 'найдено', 'найдены']);
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@robertpitt
robertpitt / basic.js
Created July 5, 2012 03:33
Sampel of Oauth flow
/**
* Oauth 2.0 basic example
*/
var express = require('express');
var oauth = require('oauth-server');
/**
* Create a new server
*/
var server = module.exports = express.createServer();
@sapegin
sapegin / main.js
Created July 13, 2012 06:24
Controls helper
/**
* Controls
*
* <span data-trigger="slider-next" data-recipient=".portfolio">Next</span>
*/
$(document).click(function(e) {
var target = e.target;
if (target.getAttribute('data-trigger') && target.getAttribute('data-recipient')) {
target = $(target);
$(target.data('recipient')).trigger(target.data('trigger'));
@sapegin
sapegin / grunt.js
Created August 15, 2012 08:42
Sapegin.me gruntfile
@lazarofl
lazarofl / geocoder_example.html
Created October 16, 2012 18:27
Google Maps V3 - Geocoder example
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Google Maps JavaScript API v3 Example: Geocoding Simple</title>
<link href="https://developers.google.com/maps/documentation/javascript/examples/default.css" rel="stylesheet">
<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script>
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active November 10, 2024 03:45
A badass list of frontend development resources I collected over time.