Skip to content

Instantly share code, notes, and snippets.

View dansup's full-sized avatar
😎
Working on @pixelfed

daniel dansup

😎
Working on @pixelfed
View GitHub Profile

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 September 3, 2016 00:08
Toggles the .is-active class for a hamburger menu
(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 April 18, 2024 21:00
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
@thefinn93
thefinn93 / github.php
Created May 17, 2013 04:06
A php script to pull from git whenever it is called (from approved IPs). It's meant to be a github service hook.
<?
$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 June 10, 2012 22:29
Cache cloudmade titles in localwiki
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/'])""",
}