Skip to content

Instantly share code, notes, and snippets.

View darcyclarke's full-sized avatar
🔥
busy building things...

Darcy Clarke darcyclarke

🔥
busy building things...
View GitHub Profile
@darcyclarke
darcyclarke / gulpfile.coffee
Created May 29, 2015 13:30
Example Build file
# --------------------------------------
# Setup
# --------------------------------------
server = false
fs = require( 'fs' )
path = require( 'path' )
_ = require( 'underscore' )
wrench = require( 'wrench' )
@darcyclarke
darcyclarke / clean.js
Created May 27, 2016 03:04
Get Clean window & DOM Objects
/*!
*
* Get Clean window & DOM Objects
* http://darcyclarke.me/articles/development/getting-a-clean-document-or-window-object-in-javascript/
*
* Copyright 2016, Darcy Clarke
* Do what you want license
*
*/
(function(){
@darcyclarke
darcyclarke / strip.php
Last active May 27, 2016 03:09
Strip text out from between two strings
<?php
/***********************************************/
/* PHP Strip Function
/* http://darcyclarke.me/articles/development/strip-out-text-between-two-tags-in-a-string-php/
/*
/* Copyright 2016, Darcy Clarke
/* Do what you want license
/***********************************************/
function strip($startTag,$endTag,$text,$pos=0){
if(!is_integer($pos)){
@darcyclarke
darcyclarke / pubsub.js
Last active September 17, 2016 17:39
Library agnostic publish/subscribe
/*!
*
* Library Agnostic Pubsub
* http://darcyclarke.me/articles/development/library-agnostic-pubsub-publish-subscribe/
*
* Copyright 2016, Darcy Clarke
* Do what you want license...
*
*/
(function(window){
@darcyclarke
darcyclarke / youtubeThumb.php
Created May 27, 2016 03:15
Get the video thumbnail for a YouTube video from a URL
<?php
/***********************************************/
/* Get a Youtube or Vimeo video's Thumbnail from a URL
/* http://darcyclarke.me/articles/development/get-image-for-youtube-or-vimeo-videos-from-url/
/*
/* Copyright 2016, Darcy Clarke
/* Do what you want license
/***********************************************/
function video_image($url){
$image_url = parse_url($url);
@darcyclarke
darcyclarke / jquery.animate.floats.js
Last active March 7, 2017 22:35
jQuery plugin for animating elements with floats
/*!
* Animate Floats jQuery Plugin
* http://darcyclarke.me/articles/development/animate-float-positions-in-jquery-1-5/
*
* Copyright 2016, Darcy Clarke
* Do what you want license
*/
(function(window, $){
var $plugin = $.sub();
$plugin.fn.animate = function(props, speed, cb){
@darcyclarke
darcyclarke / jquery.missing.selector.js
Created May 27, 2016 03:23
A jQuery filter selector for ":missing" (ie. opposite of ":contains")
/*!
*
* jQuery :missing Plugin
* http://darcyclarke.me/articles/development/find-elements-that-dont-contain-a-string/
*
* Copyright 2016, Darcy Clarke
* Do what you want license
*
*/
jQuery.expr[':'].missing = function(elem, index, match) {
@darcyclarke
darcyclarke / keybase.md
Created April 6, 2017 17:57
keybase.md

Keybase proof

I hereby claim:

  • I am darcyclarke on github.
  • I am darcyclarke (https://keybase.io/darcyclarke) on keybase.
  • I have a public key ASD4yo0sZAq8GW7-sMMPykFBSvT1luv3MwlvIVmXrBeRLQo

To claim this, I am signing this object:

@darcyclarke
darcyclarke / inject.js
Last active March 24, 2020 15:52
Facebook Sponsored Ad Filter - Use this w/ your preferred script injector (ex. "CJS" on Chrome or "Code Injector" on FF)
// Updated & working as of March 24th, 2020
;(() => {
function removeAds() {
Array.from(document.querySelectorAll('[id^=feed_sub_title], [data-testid^=story-subtilte], [data-pagelet^=FeedUnit]'))
.map(e => {
let content = e.innerText
let dynamic = Array.from(e.querySelectorAll('span:not([data-content=""])'))
.filter(e => e.style.display != 'none')
.map(e => {
let hidden = window.getComputedStyle(e, ':before').getPropertyValue('content')