Skip to content

Instantly share code, notes, and snippets.

View joshpangell's full-sized avatar

Josh Pangell joshpangell

View GitHub Profile
@joshpangell
joshpangell / gist:ba13ad8166216cd45766e7e7606ec816
Created September 28, 2020 21:31
Hide Twitter sidebars bookmarklet
javascript:(function()%7Bdocument.querySelector('header').style.visibility%3D%22hidden%22%3B%20document.querySelector('div%5Bdata-testid%3D%22sidebarColumn%22%5D').style.visibility%3D%22hidden%22%7D)()
@joshpangell
joshpangell / instagramfeed.php
Last active May 22, 2023 16:28
Query the Instagram API by username or tag. If we can't find the ID, scrape the HTML page for it
<?php
/**
* Instagram feed getter
* This will query the Instagram API and return a list of images
*/
class InstagramFeed {
public $result;
public static $display_size = 'thumbnail'; // you can choose between "low_resolution", "thumbnail" and "standard_resolution"
public static $user_id;
public $feed;
javascript:(function(){function c(){var e=document.createElement("link");e.setAttribute("type","text/css");e.setAttribute("rel","stylesheet");e.setAttribute("href",f);e.setAttribute("class",l);document.body.appendChild(e)}function h(){var e=document.getElementsByClassName(l);for(var t=0;t<e.length;t++){document.body.removeChild(e[t])}}function p(){var e=document.createElement("div");e.setAttribute("class",a);document.body.appendChild(e);setTimeout(function(){document.body.removeChild(e)},100)}function d(e){return{height:e.offsetHeight,width:e.offsetWidth}}function v(i){var s=d(i);return s.height>e&&s.height<n&&s.width>t&&s.width<r}function m(e){var t=e;var n=0;while(!!t){n+=t.offsetTop;t=t.offsetParent}return n}function g(){var e=document.documentElement;if(!!window.innerWidth){return window.innerHeight}else if(e&&!isNaN(e.clientHeight)){return e.clientHeight}return 0}function y(){if(window.pageYOffset){return window.pageYOffset}return Math.max(document.documentElement.scrollTop,document.body.scrollTop)}funct
@joshpangell
joshpangell / gist:2845221
Created May 31, 2012 18:21
Test browser for SVG/VML support
function supportsSvg() {
return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Shape", "1.0")
}
function supportsVml() {
if (typeof supportsVml.supported == "undefined") {
var a = document.body.appendChild(document.createElement('div'));
a.innerHTML = '<v:shape id="vml_flag1" adj="1" />';
var b = a.firstChild;
b.style.behavior = "url(#default#VML)";
@joshpangell
joshpangell / gist:2481668
Created April 24, 2012 17:20
Cargo's project methods
/**
* Cargo's project methods
* Manipulating projects
*/
/*
* Close a project
* This will also remove any nav/thumb highlights
*/
@joshpangell
joshpangell / gist:2220862
Last active October 2, 2015 09:38
Cargo helper methods
/**
* Cargo's helper methods
*/
/*
* Config helpers
*/
// Returns the design
Cargo.Config.GetDesign();
@joshpangell
joshpangell / gist:1840918
Last active September 30, 2015 18:08
Cargo's events that are triggered on actions as of 12/02/15
/**
* Cargo's jQuery event trigger list
*/
/*
* Fires in two places
* - After a project is done loading
* - document.ready
* returns the pid and the slideheight
*/