Skip to content

Instantly share code, notes, and snippets.

View jarnesjo's full-sized avatar

Nicklas Jarnesjö jarnesjo

View GitHub Profile

Deployment

Creating and configuring a new site / environment occurs occasionally. Often, to update the underlying server software.

This site has been built with:

@ekandreas
ekandreas / no-updates.php
Last active July 8, 2017 02:15
WordPress stop remote update check
<?php
namespace EkAndreas;
class NoWPUpdates {
private $pluginsFiles;
private $themeFiles;
function __construct() {
add_action( 'admin_init', array(&$this, 'admin_init') );
@PaulKinlan
PaulKinlan / criticalcss-bookmarklet-devtool-snippet.js
Last active March 12, 2025 01:22
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
@cosmocatalano
cosmocatalano / instagram_scrape.php
Last active February 8, 2025 07:43
Quick-and-dirty Instagram web scrape, just in case you don't think you should have to make your users log in to deliver them public photos.
<?php
//returns a big old hunk of JSON from a non-private IG account page.
function scrape_insta($username) {
$insta_source = file_get_contents('http://instagram.com/'.$username);
$shards = explode('window._sharedData = ', $insta_source);
$insta_json = explode(';</script>', $shards[1]);
$insta_array = json_decode($insta_json[0], TRUE);
return $insta_array;
}