Skip to content

Instantly share code, notes, and snippets.

View danielgwood's full-sized avatar

Daniel Wood danielgwood

View GitHub Profile
@romainnorberg
romainnorberg / ClosureExtension.php
Created October 19, 2020 11:12
Symfony Twig Closure Extension
<?php
declare(strict_types=1);
namespace AppBundle\Extension;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
class ClosureExtension extends AbstractExtension
{
@IanColdwater
IanColdwater / twittermute.txt
Last active July 2, 2024 02:25
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@princebot
princebot / install_wormhole.bat
Created July 29, 2017 17:44
Install Python magic-wormhole on Windows.
::
:: This script installs wormhole (https://github.com/warner/magic-wormhole) and
:: its prerequisites. Run this as an administrator.
::
:: Install chocolatey.
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
:: Install Python 3.
choco install -y python
@EnigmaCurry
EnigmaCurry / archive_podcast.py
Last active March 9, 2020 15:51
Basic podcast archiving script
"""Convert podcast feeds into an aria2 download script
- Setup feed output directories and URLS
- Run: python archive_podcast.py > aria2.txt
- Run: aria2c -i aria2.txt
Aria2 will download all the episodes and supports resuming of partial downloads
"""
import feedparser
@wkw
wkw / wp-parent-page-filter.php
Created October 25, 2016 18:23
WordPress: allow draft, private posts to be selected in Parent page dropdown
/**
* Show draft and private pages in hierarchicial Parent pages dropdown.
* will work for any hier. post type.
*/
function filter_attributes_dropdown_pages_args($dropdown_args) {
$dropdown_args['post_status'] = array('publish','draft', 'private');
return $dropdown_args;
}
add_filter('page_attributes_dropdown_pages_args', __NAMESPACE__ . '\\filter_attributes_dropdown_pages_args', 100, 1);
@daveio
daveio / simon-sweeney-letter.md
Last active February 23, 2016 10:03
What has the EU ever done for us?

This letter was originally published by [Guardian Letters][0], and has been reformatted for clarity and ease of reading. Other than minor punctuation and significant layout changes, it is presented verbatim.

At last we may get a debate on Britain's relationship with Europe ([Leader][1], 11 January). What did the EEC/EU ever do for us? Not much, apart from:

  • Providing 57% of our trade.
  • Structural funding to areas hit by industrial decline.
  • Clean beaches and rivers.
  • Cleaner air.
  • Lead free petrol.
  • Restrictions on landfill dumping.
@bomberstudios
bomberstudios / sketch-diff-in-git.md
Last active May 17, 2024 02:53
How to diff your .sketch files in Git

Using sketchtool to diff your .sketch files using text

Requirements

You need to have SketchTool installed somewhere in your path.

Setup

Add this in your ~/.gitconfig file (for some reason, it won't work in a local .gitconfig file):

@paulirish
paulirish / what-forces-layout.md
Last active July 18, 2024 22:41
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@paulirish
paulirish / bling.js
Last active July 3, 2024 20:45
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@ericelliott
ericelliott / essential-javascript-links.md
Last active July 18, 2024 15:03
Essential JavaScript Links