Skip to content

Instantly share code, notes, and snippets.

@pganti
pganti / gist:b47da2fa9ab2b105c3365242aeed6c81
Created January 18, 2017 02:37
sourcepoint js detection
! function(e) {
function t(r) {
if (n[r]) return n[r].exports;
var o = n[r] = {
exports: {},
id: r,
loaded: !1
};
return e[r].call(o.exports, o, o.exports, t), o.loaded = !0, o.exports
}
@antic183
antic183 / remove-utf8-bom.js
Last active March 13, 2024 08:45
remove utf-8 bom with javascript
// remove utf-8 BOM from ressource "res"
// res.charCodeAt(0) === 0xFEFF | res.charCodeAt(0) === 65279
if (res.charCodeAt(0) === 0xFEFF) {
res = res.substr(1);
}
@mhils
mhils / transparent_proxy.md
Last active March 10, 2022 01:41
Windows Transparent Proxying
  1. Enable IP forwarding
  2. Open regedit
  3. Navigate to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
  4. Change IPEnableRouter to 1
  5. Run services->Routing and Remote->start
@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