Skip to content

Instantly share code, notes, and snippets.

View Quezler's full-sized avatar
🍪
crater desires cookies.

Patrick 'Quezler' Mounier Quezler

🍪
crater desires cookies.
  • Netherlands
  • 13:59 (UTC +02:00)
View GitHub Profile
@bepcyc
bepcyc / pom.xml
Created January 30, 2012 13:08
maven plugin to run shell or batch scripts
<!--source: http://stackoverflow.com/a/3493919/918211-->
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<executions>
<execution><!-- Run our version calculation script -->
<id>Version Calculation</id>
<phase>generate-sources</phase>
<goals>
<goal>exec</goal>
@ircmaxell
ircmaxell / equality.php
Last active April 19, 2019 13:52
Unicode Set Functions
<?php
const ✓ = true;
const ✕ = false;
function ≠($left, $right) {
return $left != $right;
}
function ≅($left, $right) {
@Utopiah
Utopiah / syncNC.sh
Last active February 4, 2022 14:23
# script to (one-way) synchronize a NextCloud directory to a reMarkable device
# use it manually as ssh remarkable /home/root/bin/syncNC or via Cron or systemd
#
# configure https://nextcloud.domain.tld/remote.php/dav/files/username/ with your own NextCloud Dav URL
# add your username, password and path to /opt/etc/davfs2/secrets
# install mount.davfs via opkg install davfs2
# make the required directories e.g ~/nextcloudSync2 /media/nextcloudselfhosted/ on the reMarkable
# user reMarkable2_sync/ on your NextCould or change its location here
# do a symlink between ~/xochitl-data/ and ~/.local/share/remarkable/xochitl/
@fullybaked
fullybaked / usort.php
Created September 1, 2015 12:05
Usort with PHP7 Spaceship vs PHP5.6
<?php
// PHP 5.6
usort($array, function($a, $b) {
if ($a == $b) {
return 0;
}
return ($a < $b) ? -1 : 1;
});
@ArtBIT
ArtBIT / thou shall not pusg merge commits.txt
Last active August 6, 2022 16:41
PUSH REJECTED BY EVIL DRAGON BUREAUCRATS
+---------------------------------------------------------------+
| * * * PUSH REJECTED BY EVIL DRAGON BUREAUCRATS * * * |
+---------------------------------------------------------------+
\
\ ^ /^
\ / \ // \
\ |\___/| / \// .\
\ /V V \__ / // | \ \ *----*
/ / \/_/ // | \ \ \ |
@___@` \/_ // | \ \ \/\ \
vim.o.background = "light"
vim.o.termguicolors = true
if vim.g.colors_name then vim.cmd("hi clear") end
vim.cmd("syntax reset")
vim.g.colors_name = "Boring Tomorrow"
-- Default GUI Colours
@faisalman
faisalman / baseConverter.js
Last active January 11, 2023 14:43
Convert From/To Binary/Decimal/Hexadecimal in JavaScript
/**
* Convert From/To Binary/Decimal/Hexadecimal in JavaScript
* https://gist.github.com/faisalman
*
* Copyright 2012-2015, Faisalman <fyzlman@gmail.com>
* Licensed under The MIT License
* http://www.opensource.org/licenses/mit-license
*/
(function(){
(function() {
// NOTE: I have intentionally avoided the use of jQuery in
// the next two functions so as not to obscure any details.
// Updates the DOM in such a way that layout is constantly
// computed and thrown away.
var UpdateThrash = function(data) {
// Get all the labels
var spans = document.querySelectorAll('.item .lab');
@chrisveness
chrisveness / utf8-regex.js
Last active May 25, 2023 01:53
Utf8 string encode/decode using regular expressions
/**
* Encodes multi-byte Unicode string into utf-8 multiple single-byte characters
* (BMP / basic multilingual plane only).
*
* Chars in range U+0080 - U+07FF are encoded in 2 chars, U+0800 - U+FFFF in 3 chars.
*
* Can be achieved in JavaScript by unescape(encodeURIComponent(str)),
* but this approach may be useful in other languages.
*
* @param {string} unicodeString - Unicode string to be encoded as UTF-8.