Skip to content

Instantly share code, notes, and snippets.

View jrfnl's full-sized avatar
🐘
Herding 🐘

Juliette jrfnl

🐘
Herding 🐘
View GitHub Profile
@mcclure
mcclure / add-to-Stylus-to-flag-nfts.css
Last active January 21, 2022 09:34
Download the "Stylus" browser extension and add this for all Twitter NFT users to be unambiguously flagged as such. Not written by me.
[style^='clip-path: url("#hex-hw-shapeclip-clipconfig");']
{
background-color: black;
}
[style^='clip-path: url("#hex-hw-shapeclip-clipconfig");']::before
{
background-color: black;
color: white;
content: "NFT USER lmao";
<?php
function spl_push_error_handler(ErrorHandler $handler, int $level = \E_ALL, int $priority = 0): void
{
// this function would be built into PHP, possibly with the addition of some extra functions to inspect and remove
// existing error handlers
// pushed error handlers would take priority over an error handlers set with set_errorhandler(), which would only be called
// if the error is not handled by a handler in the stack.
@wpscholar
wpscholar / functions.php
Last active March 1, 2021 13:26
Enqueueing IE conditional stylesheets in WordPress the right way
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' );
/**
* Example callback function that demonstrates how to properly enqueue conditional stylesheets in WordPress for IE.
* IE10 and up does not support conditional comments in standards mode.
*
* @uses wp_style_add_data() WordPress function to add the conditional data.
* @link https://developer.wordpress.org/reference/functions/wp_style_add_data/
@ryansechrest
ryansechrest / server-to-localhost.sh
Created December 23, 2013 07:40
Bash script to synchronize website directory and database between server and localhost or server and server.
#!/bin/bash
# Created on 10/8/13 by Ryan Sechrest
# site (localhost edition)
# Program to mirror a directory and database of a website between two servers.
### Program meta data
@Rarst
Rarst / .scrutinizer.yml
Last active August 13, 2019 11:37
Scrutinizer config to install PHPUnit on the fly, without shipping in project dependencies.
filter:
excluded_paths:
- 'tests/*'
checks:
php: true
build:
environment:
php:
version: 7.2
dependencies:
@cameronmalek
cameronmalek / pre-receive.sh
Last active February 4, 2019 18:37
The `hooks/pre-receive` file I use for cameronmalek.com and other sites. It makes sure the working directory is clean before pushing updates, forcing the developer to commit and pull server-side updates first. It doesn't detect any staged, uncommitted files. A situation where someone stages but fails to commit a file isn't anticipated.
#!/bin/sh
export GIT_WORK_TREE=/home/cameronm/public_html/
export GIT_DIR=/home/cameronm/git/cameronmalek.git
ec=0
# test for unstaged, uncommitted files
git diff --exit-code &>-
if [ "$?" -ne 0 ]; then
echo "Changes not staged"
@szepeviktor
szepeviktor / wp-badrequest.php
Last active December 29, 2018 15:43
WordPress bad request - help Fail2ban to ban "deadly" requests
MOVED to: https://github.com/szepeviktor/wordpress-fail2ban/tree/master/block-bad-requests
@DragonBe
DragonBe / php_conferences_2016.md
Last active February 9, 2018 08:02
Overview of PHP oriented conferences in 2016 (excluding polyglot and framework oriented conferences)
@manchuck
manchuck / pre-commit
Last active September 19, 2017 16:34
This is a ZF2 precommit hook that runs Lint, Mess Detector, Code sniffer then classmap builder on commit
#!/bin/sh
echo
exec powershell.exe -ExecutionPolicy RemoteSigned -File '.\.git\hooks\pre-commit-hook.ps1'
exit
@ryansechrest
ryansechrest / post-receive.sh
Last active February 12, 2017 12:41
Git post-receive hook to deploy WordPress and plugins as submodules. It can also install Node.js modules with npm and vendor packages with Composer.
#!/bin/bash
# Created on 7/17/13 by Ryan Sechrest
# Deploys pushed branch from the origin repository to the web directory
if [[ (-n $1) && (-n $2) && (-n $3) ]]; then
# Set path to project directory
project_path="/var/www/domains/$2/$3"