Skip to content

Instantly share code, notes, and snippets.

View kirillzubovsky's full-sized avatar
💭
High on catnip 🙀

Kirill Zubovsky kirillzubovsky

💭
High on catnip 🙀
View GitHub Profile
@jeffrafter
jeffrafter / server.js
Created August 28, 2010 21:37
Twitter OAuth with node-oauth for node.js+express
var express = require('express');
var sys = require('sys');
var oauth = require('oauth');
var app = express.createServer();
var _twitterConsumerKey = "YOURTWITTERCONSUMERKEY";
var _twitterConsumerSecret = "YOURTWITTERCONSUMERSECRET";
function consumer() {
@intents
intents / intents.html
Created March 30, 2011 14:50
Invoke Intents
<script type="text/javascript">
(function() {
if (window.__twitterIntentHandler) return;
var intentRegex = /twitter\.com(\:\d{2,4})?\/intent\/(\w+)/,
windowOptions = 'scrollbars=yes,resizable=yes,toolbar=no,location=yes',
width = 550,
height = 420,
winHeight = screen.height,
winWidth = screen.width;
@jheitzeb
jheitzeb / gist:1104924
Created July 25, 2011 19:15
Google Docs Survey Emailer
function onFormSubmit(e) {
var to_email = "YOUREMAIL@YOURCOMPANY.COM";
var ss = SpreadsheetApp.getActiveSpreadsheet();
var spreadsheet_name = ss.getName();
var sheet = ss.getSheets()[0];
var columns = sheet.getRange("A1:U1").getValues()[0];
var email_subject = "New response for [" + spreadsheet_name + "]";
var email_body = "Spreadsheet: " + spreadsheet_name + "\r\n\r\n";
var email_body_html = "<p><b>Spreadsheet: " + spreadsheet_name + "</b></p>";
# DEV RELOAD FOR JQUERY / UNDERSCORE
$ = jQuery
# add reloadElement to underscore
_.mixin
# reloads a particular element
reloadElement: (element) ->
if element and element.tagName
tag = element.tagName.toUpperCase()
@spraints
spraints / gist:1648617
Created January 20, 2012 17:40
setting up a subscription with stripe

Subscriptions with stripe

Code examples use the stripe ruby gem. Most of the links are to stripe's documentation.

![stripe's object model][stripe_object_model_diagram]

Initial setup

To start, create some plans.

@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@font-face {
font-family: 'EntypoRegular';
src: url('font/entypo.eot');
src: url('font/entypo.eot?#iefix') format('embedded-opentype'),
url('font/entypo.woff') format('woff'),
url('font/entypo.ttf') format('truetype'),
url('font/entypo.svg#EntypoRegular') format('svg');
font-weight: normal;
font-style: normal;
}
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active July 17, 2024 14:20
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@fredsterss
fredsterss / loading.coffee
Created June 4, 2013 00:10
Elegant loading
# handle ajax events (loading and auth errors)
$(document).ajaxStart ->
settings = lines: 12, length: 6, width: 4, radius: 8, trail: 75, color: '#fff'
$('.loading-main').html new r.ui.spinner( settings ).spin().el
$('[data-section=logo]').addClass('loading')
$(document).ajaxStop ->
$('[data-section=logo]').removeClass('loading')
$(document).ajaxComplete (e, xhr, options) ->
r.errorHandler.handle(xhr)
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
CYN='\e[1;96m'
# git dirty branch
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "(._.)"
}
function parse_git_clean {