Skip to content

Instantly share code, notes, and snippets.

@matfax
matfax / .zshrc
Created March 6, 2023 13:38
Sudo authentication with Windows 1Password CLI on Ubuntu WSL
# ....
alias sudo="sudo -A"
@bchanudet
bchanudet / readme.md
Last active December 31, 2023 13:47
Framebuffer on ST7735s (1.44inch LCD HAT)

Enable modules in Kernel

In raspi-config

Enable SPI under "Interfacing options"

Add modules

$ sudo nano /etc/modules
@uphy
uphy / node-red-multiline-shellscript.json
Last active December 14, 2020 15:36
Node-RED Execute multiline shell script
[{"id":"1a73c740.e06d79","type":"subflow","name":"Execute Shell Script","info":"","in":[{"x":100,"y":200,"wires":[{"id":"662c3c62.43d624"}]}],"out":[{"x":960,"y":280,"wires":[{"id":"9e92978.d8d0868","port":0}]},{"x":960,"y":340,"wires":[{"id":"9e92978.d8d0868","port":1}]},{"x":960,"y":400,"wires":[{"id":"9e92978.d8d0868","port":2}]}]},{"id":"dda86e6b.3b362","type":"file","z":"1a73c740.e06d79","name":"Write script file","filename":"","appendNewline":true,"createDir":false,"overwriteFile":"false","x":860,"y":140,"wires":[]},{"id":"7a2a96f.a52b268","type":"exec","z":"1a73c740.e06d79","command":"mktemp","addpay":false,"append":"","useSpawn":"","timer":"","name":"","x":420,"y":200,"wires":[["9131a546.667eb8"],[],[]]},{"id":"c9fb5364.0becc","type":"file","z":"1a73c740.e06d79","name":"Delete script file","filename":"","appendNewline":true,"createDir":false,"overwriteFile":"delete","x":1020,"y":480,"wires":[]},{"id":"9e92978.d8d0868","type":"exec","z":"1a73c740.e06d79","command":" sh ","addpay":true,"append":"","useS
@dropmeaword
dropmeaword / corsproxy.php
Last active July 16, 2024 01:28
simple CORS proxy in php
<?php
error_reporting( error_reporting() & ~E_NOTICE ); // evil
// config
$enable_jsonp = false;
$enable_native = false;
$valid_url_regex = '/.*/';
// ############################################################################
@ewistrand
ewistrand / wp-tags-to-search.php
Created February 25, 2016 13:21
Add tags to wordpress search
<?php
// ADD Tags To SEARCH
function my_smart_search( $search, &$wp_query ) {
global $wpdb;
if ( empty( $search ))
return $search;
$terms = $wp_query->query_vars[ 's' ];
$exploded = explode( ' ', $terms );
@lukas-h
lukas-h / license-badges.md
Last active July 27, 2024 13:38
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)

@Deevad
Deevad / wacom.sh
Last active October 10, 2022 10:49
A bash script for an advanced setup of a Wacom on Linux : with a grep, automatic parsing of the Wacom identifier, of the screen, of dpi and with a precision mode ( drawing at 1:1 scale , the tablet / the screen ) . Only the button layout remain custom to the model ( Intuos 3 in this example ) and can be easily adapted with other buttons ID.
#! /bin/bash
# A bash script for an advanced setup of a Wacom on Linux :
# with a grep, automatic parsing of the Wacom identifier, of the screen, of dpi and with a precision mode
# ( drawing at 1:1 scale , the tablet / the screen ) .
# Only the button layout remain custom to the model ( Intuos 3 in this example )
# and can be easily adapted with other buttons ID.
#
# Dependencies: libwacom (xsetwacom), Bash and bc for the math, xrandr
# optional: Gnome icon, notify-send
# ( tested/created on Mint 17.2 Cinnamon, 11/2015 )
@zacharytamas
zacharytamas / gist:082e538784ebe07e40f9
Created June 13, 2014 19:24
Override window.location
(function () {
var _window = window;
(function () {
var window = {};
Object.defineProperty(window, 'location', {
get: function () { return _window.location; },
@DWboutin
DWboutin / Merge wp_query
Created February 7, 2014 14:17
Merge 2 WP_Query()
<?php
$query1 = new WP_Query($arg1);
$query2 = new WP_Query($arg2);
$query = new WP_Query();
$query->posts = array_merge( $query1->posts, $query2->posts );
// we also need to set post count correctly so as to enable the looping
@barneycarroll
barneycarroll / README.md
Last active August 29, 2022 12:02
Lock and unlock a page's scroll position.

jquery.scrollLock.js

Useful for when a blocking user experience is needed (in my case, didn't want people unwittingly loosing their place by scrolling while a modal required their attention): $.scrollLock() locks the body in place, preventing scroll until it is unlocked.

// Locks the page if it's currently unlocked
$.scrollLock();

// ...or vice versa