Skip to content

Instantly share code, notes, and snippets.

View jeroenvisser101's full-sized avatar
🇺🇦
Слава Україні!

Jeroen Visser jeroenvisser101

🇺🇦
Слава Україні!
View GitHub Profile
import * as React from "react";
import { useMousePosition } from "~/hooks/useMousePosition";
/** Component to cover the area between the mouse cursor and the sub-menu, to allow moving cursor to lower parts of sub-menu without the sub-menu disappearing. */
export function MouseSafeArea(props: { parentRef: React.RefObject<HTMLDivElement> }) {
const { x = 0, y = 0, height: h = 0, width: w = 0 } = props.parentRef.current?.getBoundingClientRect() || {};
const [mouseX, mouseY] = useMousePosition();
const positions = { x, y, h, w, mouseX, mouseY };
return (
<div
@eyecatchup
eyecatchup / mr.robot_season-2_easter-egg-sites.md
Last active April 4, 2024 10:39
A collection of "Mr. Robot" Season 2 Easter Egg Sites. #mrrobot #hackingrobot #robotegg
@jamonholmgren
jamonholmgren / plug.conn.ex
Created March 9, 2016 07:00
Typical Elixir Phoenix Plug.Conn struct contents, in an easy-to-read format. By Jamon Holmgren.
%Plug.Conn{
adapter: {Plug.Adapters.Cowboy.Conn, :...},
assigns: %{
my_assigns: "here"
},
before_send: [
#Function<7.125546534/1 in Phoenix.Controller.fetch_flash/2>,
#Function<1.127904613/1 in Plug.Session.before_send/2>,
#Function<1.43511252/1 in Plug.Logger.call/2>,
#Function<0.70322810/1 in Phoenix.LiveReloader.before_send_inject_reloader/1>
@jeroenvisser101
jeroenvisser101 / README.md
Last active February 20, 2016 19:44
Copy Sketch templates from git repository to the Sketch template folder

Easily work with sketch templates on Git, by having a script that updates them from your repository

@bmorton
bmorton / htop-osx.rb
Last active February 14, 2016 20:50
class HtopOsx < Formula
desc "Improved top (interactive process viewer) for OS X"
homepage "http://hisham.hm/htop/"
url "http://hisham.hm/htop/releases/2.0.0/htop-2.0.0.tar.gz"
sha256 "d15ca2a0abd6d91d6d17fd685043929cfe7aa91199a9f4b3ebbb370a2c2424b5"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
@jeroenvisser101
jeroenvisser101 / git-finish
Last active December 19, 2018 16:18
Merge a branch using --ff-only, check status checks, and remove branches locally and on remote.
#!/usr/bin/env ruby
def notice(text)
puts "\e[33m#{text}\e[0m"
end
def success(text)
puts "\e[32m#{text}\e[0m"
end
def error(text)
@johnbintz
johnbintz / simple-capistrano-docker-deploy.rb
Last active April 3, 2023 08:23
Simple Capistrano deploy for a Docker-managed app
# be sure to comment out the require 'capistrano/deploy' line in your Capfile!
# config valid only for Capistrano 3.1
lock '3.2.1'
set :application, 'my-cool-application'
# the base docker repo reference
set :name, "johns-stuff/#{fetch(:application)}"
@pcreux
pcreux / pipable.rb
Last active June 12, 2018 17:08
*nix has pipes, Elixir has pipes, Ruby deserves pipes.
# Elixir has pipes `|>`. Let's try to implement those in Ruby.
#
# I want to write this:
#
# email.body | RemoveSignature | HighlightMentions | :html_safe
#
# instead of:
#
# HighlightMentions.call(RemoveSignature.call(email.body)).html_safe
#
@phpdude
phpdude / Git hook sync modification time to last commit time
Last active May 20, 2018 23:56
Git post-merge & post-checkout hook for sync changed files timestamps with last commit time (Linux, FreeBSD, Mac OS)
Git hook post-merge and post-checkout for sync modification time to last commit time.
You can download scripts manually and install them yourself, or you can install it with command
> curl -s https://gist.githubusercontent.com/phpdude/9464925/raw/install | sh
This command will download post-merge script, chmod it, and create post-checkout symlink to post-merge hook.
You can also start this script manually with environment variable $GIT_MERGE_LIMIT=100 to updated timestamp of last 100 commits for example.
@coffeemug
coffeemug / gist:6168031
Last active February 3, 2022 23:16
The fun of implementing date support
After spending the better part of the month implementing date support
in RethinkDB, Mike Lucy sent the team the following e-mail. It would
have been funny, if it didn't cause thousands of programmers so much
pain. Read it, laugh, and weep!
-----
So, it turns out that we're only going to support dates between the
year 1400 and the year 10000 (inclusive), because that's what boost
supports.