Skip to content

Instantly share code, notes, and snippets.

View atestu's full-sized avatar

Alexandre Testu atestu

View GitHub Profile
@mfkp
mfkp / index.html
Created December 17, 2011 01:39
mailchimp ajax signup form example
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="jquery.ketchup.all.min.js" type="text/javascript"></script>
</head>
<body>
<div id="email">
<span>Enter your email to sign up</span>
<form action="/subscribe.php" id="invite" method="POST">
@lancejpollard
lancejpollard / meta-tags.md
Created March 5, 2012 13:54
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@pheuter
pheuter / sc-dl.js
Created March 5, 2012 20:44
Bookmarklet that generates download link for a Soundcloud upload
(function(d) {
var dl = d.createElement('a');
dl.innerText = 'Download MP3';
dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1];
dl.download = d.querySelector('em').innerText+".mp3";
d.querySelector('.primary').appendChild(dl);
dl.style.marginLeft = '10px';
dl.style.color = 'red';
dl.style.fontWeight = 700;
})(document);
@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

@collegeman
collegeman / wp-recent-posts-by-comments.php
Created May 18, 2012 16:14 — forked from coreyweb/gist:2718955
Recent WordPress Posts by Comment Frequency
<?php
/*
@author Corey Brown https://github.com/coreyweb
This code will display the 10 most commented on posts.
Rules:
- published within the last month
- at least one comment made in the last week
@irace
irace / gist:3828834
Created October 3, 2012 18:29
Basic Node.js screen-scraping
var express = require('express')
, app = express()
, jsdom = require('jsdom');
app.set('views', __dirname);
app.get('/', function(request, response) {
jsdom.env({
html: 'http://bryanirace.com',
scripts: ['http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.0/jquery.min.js'],
@malarkey
malarkey / Contract Killer 3.md
Last active May 24, 2024 23:38
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

['rg_di', 'rg_li'].forEach(function(cl){Array.prototype.slice.call(document.getElementsByClassName(cl)).forEach(function(el){el.style.margin = 0;});})
@mathisonian
mathisonian / browser-export.js
Created November 9, 2014 19:54
exporting client side code
// export as a Node module, an AMD module or a global browser variable
if (typeof module !== 'undefined') {
module.exports = myModule;
} else if (typeof define === 'function' && define.amd) {
define(function() {
return myModule;
});