Skip to content

Instantly share code, notes, and snippets.

View ElvisLives's full-sized avatar

Peter S. ElvisLives

  • Location3 Media.
  • Denver
View GitHub Profile
@ElvisLives
ElvisLives / RedisApiOutputCache.cs
Last active July 26, 2016 17:18
A working version of IApiOutputCache with Redis (Has some caveats around dependencies.)
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using CachingFramework.Redis;
using WebApi.OutputCache.Core.Cache;
namespace Some.Cool.NameSpace.Goes.Here
{
/// <summary>
@mickaelandrieu
mickaelandrieu / quotes_csv.js
Last active May 19, 2017 15:29
Scrap a website using CasperJs, CSV export
var quotes = 0;
var maxLinks = 5;
var firstUrl = 'http://www.imdb.com/search/title?at=0&num_votes=5000,&sort=user_rating,desc&start=1&title_type=tv_infoss';
var x = require('casper').selectXPath;
var fs = require('fs');
var utils = require('utils');
var casper = require('casper').create({
verbose: true,
@Sulcalibur
Sulcalibur / casperscreens.js
Created August 1, 2013 13:42
Casper.js change of file name to show url and saved to root screenshot directory ref: http://net.tutsplus.com/tutorials/javascript-ajax/responsive-screenshots-with-casper/
var casper = require("casper").create(),
viewportSizes = [
[320,480],
[320,568],
[600,1024],
[1024,768],
[1280,800],
[1440,900]
],
url = casper.cli.args[0],
@dariusk
dariusk / amazonlogin.js
Created November 14, 2012 14:39
Logging in to Amazon using PhantomJS
// phantomjs code to log in to Amazon
// based on the code from this Stackoverflow answer: http://stackoverflow.com/questions/9246438/how-to-submit-a-form-using-phantomjs
// I'm injecting jQuery so this assumes you have jquery in your project directory
var page = new WebPage(), testindex = 0, loadInProgress = false;
page.onConsoleMessage = function(msg) {
console.log(msg);
};
@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

@JoshClose
JoshClose / ScreenShot.cs
Created November 15, 2011 05:38
Programmatically Taking a Full Web Page Screenshot
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;
public class ScreenShot
{
[ComImport]
[InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
[Guid( "0000010d-0000-0000-C000-000000000046" )]
@endolith
endolith / Has weird right-to-left characters.txt
Last active October 26, 2024 13:55
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶