Skip to content

Instantly share code, notes, and snippets.

Avatar
😎
Working on @pixelfed

daniel dansup

😎
Working on @pixelfed
View GitHub Profile
View Pixelfed Mac Dev Setup.md

The easiest way to run Pixelfed for development on Mac is using Laravel's Valet. Valet contains a number of tools to run the application locally with minimal fuss.

You'll need to install Homebrew, a Mac package manager, to start off. Once you've installed Homebrew, if you haven't already installed PHP 7.3, install it with brew install php.

After installing PHP, you'll want to install Composer, which is a PHP dependency manager that can also install Valet for you. Then run composer global require laravel/valet, which will install Valet as a globally-available program. To access it, be sure to add ~/.composer/vendor/bin to your shell's PATH variable. Then run valet install to finish installing Valet's dependencies.

Running the valet park command inside a folder will allow you to access [subfolder].test as a local domain. You can set this up however you wish, though an

@Bradcomp
Bradcomp / toggle-menu.js
Created Sep 3, 2016
Toggles the .is-active class for a hamburger menu
View toggle-menu.js
(function() {
var burger = document.querySelector('.nav-toggle');
var menu = document.querySelector('.nav-menu');
burger.addEventListener('click', function() {
burger.classList.toggle('is-active');
menu.classList.toggle('is-active');
});
})();
@lukehedger
lukehedger / ffmpeg-compress-mp4
Last active Nov 29, 2021
Compress mp4 using FFMPEG
View ffmpeg-compress-mp4
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
@thefinn93
thefinn93 / github.php
Created May 17, 2013
A php script to pull from git whenever it is called (from approved IPs). It's meant to be a github service hook.
View github.php
<?
$github_ips = array("207.97.227.253/32", "50.57.128.197/32", "108.171.174.178/32", "50.57.231.61/32", "204.232.175.64/27", "192.30.252.0/22");
function cidr_match($ip, $cidr) {
list($subnet, $mask) = explode('/', $cidr);
if ((ip2long($ip) & ~((1 << (32 - $mask)) - 1) ) == ip2long($subnet))
{
return true;
}
@philipn
philipn / gist:2907544
Created Jun 10, 2012
Cache cloudmade titles in localwiki
View gist:2907544
You'll want to replace 'localwiki.org' with your hostname here.
----------------------
Add to localsettings.py:
OLWIDGET_CUSTOM_LAYER_TYPES = {
'cachedcloudmade': """OpenLayers.Layer.CachedCloudMade('CachedCloudMade',
['//map-a.localwiki.org/tile/ca694687020d468283a545db191bcb81/35165/256/',
'//map-b.localwiki.org/tile/ca694687020d468283a545db191bcb81/35165/256/',
'//map-c.localwiki.org/tile/ca694687020d468283a545db191bcb81/35165/256/'])""",
}