Skip to content

Instantly share code, notes, and snippets.

View megclaypool's full-sized avatar

Meg Claypool megclaypool

View GitHub Profile
@pihentagy
pihentagy / obsidian.css
Created October 9, 2020 09:34
Clutter free edit mode
/* inline formatting, link targets and [[ ]] disappears if not active line*/
div:not(.CodeMirror-activeline) > .CodeMirror-line span.cm-formatting,
div:not(.CodeMirror-activeline) > .CodeMirror-line span.cm-string.cm-url,
div:not(.CodeMirror-activeline) > .CodeMirror-line span.cm-formatting-link,
div:not(.CodeMirror-activeline)>.CodeMirror-line span.cm-hmd-barelink,
div:not(.CodeMirror-activeline)>.CodeMirror-line span.cm-comment
{ display: none; }
/* hide all html tags -- IT IS COMMENTED OUT BY DEFAULT */
/* div:not(.CodeMirror-activeline) > .CodeMirror-line span.cm-tag{ display: none; } */
@megclaypool
megclaypool / cloudSettings
Last active February 6, 2024 23:19
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-08-03T07:17:08.652Z","extensionVersion":"v3.4.3"}
@Billz95
Billz95 / .php_cs.dist
Last active June 3, 2024 06:09
A Customised fixer for PHP-CS-Fixer to use `prettier`'s php plugin to pre-process the code before getting analysed by other fixers. This would enable `php-cs-fixer` to take advantage of `prettier`'s ability of managing long line.
<?php
require_once __DIR__.'/relative/path/to/PrettierPHPFixer/File';
return PhpCsFixer\Config::create()
->registerCustomFixers([
(new PrettierPHPFixer()),
])
->setRules([
'Prettier/php' => true,
@rhukster
rhukster / sphp.sh
Last active March 30, 2024 10:41
Easy Brew PHP version switching (Now moved to https://github.com/rhukster/sphp.sh)
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
#
# >>> IMPORTANT: Moved to: https://github.com/rhukster/sphp.sh
# >>> Kept here for legacy purposes
#
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
@netraagal
netraagal / WindowFeatureContext.php
Last active October 22, 2022 17:56
Behat, MinkExtension & Selenium2 Driver - move, create, delete window or tab (depends on your configurations)
<?php
/**
* some functions to create a new tab/window (it's up to your personal settings),
* to move between them (to the right, to the left or by it's number in the list of windows.
* You can also close the current window or close all (the first window will be open as if you
* close it, the Scenario will fails).
*
* I block the actual driver is not an instance of Selenium2 driver, but I don't really remember
* if it's an obligation :)
*
@caseywatts
caseywatts / quicktime-hangouts-recording.md
Last active February 14, 2024 02:18
Quicktime Hangouts Recording (using soundflower for audio)

Short link to this page: caseywatts.com/quicktime

Other gists & tricks: http://caseywatts.com/gists-and-tricks

Unrelated update: my book is out! Debugging Your Brain is an applied psychology / self-help book

Quicktime + Hangouts Recording

Scenario: You want to talk with someone over google hangouts (like for a user study), and you want to record BOTH:

@w00fz
w00fz / sphp.sh
Last active February 7, 2022 00:12
PHP switcher
#!/bin/bash
# Check if command was ran as root.
if [[ $(id -u) -eq 0 ]]; then
echo "The command \"sphp\" should not be executed as root or via sudo directly."
echo "When a service requires root access, you will be prompted for a password as needed."
exit 1
fi
# Usage
@LittleCoding
LittleCoding / myelement.html.twig
Created September 27, 2016 13:37
Current URL path via Twig in Drupal 8
{#
/**
* @file
* Get the current URL path via Drupal 8 route name and twig function.
*/
#}
<a href="{{ url('<current>') }}">Current page</a>
@tmslnz
tmslnz / dnsmasq.md
Last active March 20, 2023 07:07
Setting up dnsmasq on OS X

Install dnsmasq

Via brew or other method

Set up DNS resolver order

In order to work on every connection and on any TLD, dnsmasq needs to be the first DNS resolver receving the query.

And since dnsmasq is a local process, all DNS queries need to go to 127.0.0.1

On macOS, /etc/resolv.conf is automaticaly created, depending on a variety of things (network settings, etc), so it cannot be edited.

@jelera
jelera / gulpfile.js
Created August 18, 2016 02:06
Gulp Frontend Build System
var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var pug = require('gulp-pug');
var useref = require('gulp-useref');
var uglify = require('gulp-uglify');
var gulpIf = require('gulp-if');
var cssnano = require('gulp-cssnano');
var sourcemaps = require('gulp-sourcemaps');
var imagemin = require('gulp-imagemin');