Skip to content

Instantly share code, notes, and snippets.

View jonathanmarvens's full-sized avatar

Jonathan Barronville jonathanmarvens

View GitHub Profile
@mutewinter
mutewinter / README.md
Last active December 8, 2021 11:01
Prevent Double Tap Zoom in React for Rapidly Tapped Buttons

Prevent Double Tap Zoom in React for Rapidly Tapped Buttons

Touch delay is [a thing of the past][td], but accidental zooming is here to ruin your day. Ever tapped a button quickly on iOS and experienced a zoom instead of two taps? You're in the right place.

Before

Before

@mcastelino
mcastelino / iptables-cheatsheet.md
Last active May 2, 2024 21:27
iptables-cheatsheet

The netfilter hooks in the kernel and where they hook in the packet flow

The figure below calls out

  • The netfilter hooks
  • The order of table traversal
@eevee
eevee / gist:55426e5856f5825317b1
Last active January 28, 2021 22:51
adblock rules to hide mentions from people who don't follow you

Pop open "filter preferences" in adblock plus, and add the following rules to hide mentions from people who don't follow you (and who you don't follow).

For the interactions/notifications page:

twitter.com##.interaction-page [data-follows-you="false"][data-you-follow="false"]:not(.my-tweet)

For the mentions page:

twitter.com##.mentions-page [data-follows-you="false"][data-you-follow="false"]:not(.my-tweet)
@rupey
rupey / mandelbrot.sql
Last active December 7, 2020 05:38
Mandelbrot plot in postgres
WITH RECURSIVE
x(i) AS ( VALUES (0)
UNION ALL SELECT i + 1
FROM x
WHERE i < 101),
Z(Ix, Iy, Cx, Cy, X, Y, I) AS (
SELECT
Ix,
Iy,
X :: FLOAT,
@vmbrasseur
vmbrasseur / negotiation.markdown
Last active April 24, 2018 17:20
Negotiation Articles/Resources
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@mitchwongho
mitchwongho / Docker
Last active November 29, 2023 06:36
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@disnet
disnet / gist:6171843
Created August 7, 2013 07:06
thinking about sweet.js and code completion

Let's say you want to implement TypeScript with macros:

function foo(str: string) {
    return str.toUpperCase()
    //        ^
    // want to provide completion here
}

So we define the function macro:

@pborreli
pborreli / YourCommand.php
Last active August 23, 2020 09:48
Show progress of a file download inside Symfony 2.3 console #howto
<?php
protected function execute(InputInterface $input, OutputInterface $output)
{
$progress = $this->getHelperSet()->get('progress');
$ctx = stream_context_create(array(), array('notification' => function ($notification_code, $severity, $message, $message_code, $bytes_transferred, $bytes_max) use ($output, $progress) {
switch ($notification_code) {
case STREAM_NOTIFY_FILE_SIZE_IS:
$progress->start($output, $bytes_max);
break;
@JeffreyWay
JeffreyWay / gist:5380399
Last active December 16, 2015 04:49
I've been spending a lot of time lately figuring out how to make testing as simple as possible. Mocking is a sore point for lots of folks. What do you think of this, for more natural mocking?
<?php
public function testIndex()
{
// Mock the Dog class
// Expect all() method to be called
// and return 'foo'
$this->dog->all()->shouldReturn('foo');
// Call /dogs (DB won't be hit)