Skip to content

Instantly share code, notes, and snippets.

View barijaona's full-sized avatar

Barijaona Ramaholimihaso barijaona

View GitHub Profile
@hf02
hf02 / DOM3D.user.js
Last active March 29, 2024 03:57 — forked from OrionReed/dom3d.js
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// ==UserScript==
// @name 3D DOM viewer
// @namespace https://gist.github.com/hf02/2f2fb776ba233fd758af559b9de9e177
// @version 2024-03-27
// @description 3D DOM viewer
// @author OrionReed (forked by hf02)
// @match *://*/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant GM_registerMenuCommand
// ==/UserScript==
@brennanMKE
brennanMKE / README.md
Last active May 11, 2022 08:49
Xcode Purge

Xcode Purge

Sometimes you just have to purge. With Xcode, it helps to completely blow away the Derived Data and SPM Cache directories. These directories contain all of the build artifacts produced by Xcode and resolved Swift packages. When a clean action does not completely reset your build it is time to purge.

These 2 functions can be added to your shell so you can simply run xcpurge to send Derived Data and SPM Cache to your Trash. You can recover it if necessary.

Usage

You likely are now using zsh with macOS and so you can update ~/.zshrc to define these functions. What I recommend is creating a folder at ~/.shell and create a file named ~/.shell/functions in that folder. Add the functions below to this file. Make sure to also run chmod u+x ~/.shell/functions and then add source $HOME/.shell/functions to ~/.zshrc so your shell has these functions defined. You can then run xcpurge or trash like any other command. The first time you run it you will need to grant permission since i

@gruber
gruber / Liberal Regex Pattern for Web URLs
Last active April 22, 2024 19:02
Liberal, Accurate Regex Pattern for Matching Web URLs
The regex patterns in this gist are intended only to match web URLs -- http,
https, and naked domains like "example.com". For a pattern that attempts to
match all URLs, regardless of protocol, see: https://gist.github.com/gruber/249502
# Single-line version:
(?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|s
@sprhawk
sprhawk / gist:2779208
Created May 24, 2012 03:06
git diff localizable.strings
(from :http://www.entropy.ch/blog/Developer/2010/04/15/Git-diff-for-Localizable-strings-Files.html)
First, add this to the project’s .git/info/attributes file:
+
*.strings diff=localizablestrings
(Unfortunately you do have to add it to every project, there doesn’t seem to be a global attributes configuration file)
Second, add this to your ~/.gitconfig file: