Skip to content

Instantly share code, notes, and snippets.

@joshcangit
joshcangit / Image Clipboard Filer.md
Last active Sep 19, 2020 — forked from orschiro/Image Clipboard Filer.md
Python script that saves an image from clipboard to a file.
View Image Clipboard Filer.md

Introduction

Saves an image from clipboard to a file.

Dependencies:

  • python3
  • PyGTK

Installation

@joshcangit
joshcangit / xseei.export-all.js
Last active Nov 10, 2020 — forked from nohamelin/xseei.export-all.js
Export your search engines in only-WebExtensions Mozilla Firefox builds
View xseei.export-all.js
// -sp-context: browser
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
* xseei.export-all.js
* ===================
* code-revision 3
* https://gist.github.com/nohamelin/6af8907ca2dd90a9c870629c396c9521
@joshcangit
joshcangit / xseei.import.js
Last active Jan 16, 2021 — forked from nohamelin/xseei.import.js
Import search engines in only-WebExtensions Mozilla Firefox builds
View xseei.import.js
// -sp-context: browser
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
* xseei.import.js
* ===============
* code-revision 2
* https://gist.github.com/nohamelin/8e2e1b50dc7d97044992ae981487c6ec
@joshcangit
joshcangit / JanksonExample.java
Last active Sep 2, 2021
Example on using Jankson for reading and writing to a file.
View JanksonExample.java
//usr/bin/env jbang "$0" "$@";exit $?
//DEPS blue.endless:jankson:1.2.1
import java.io.IOException;
import java.io.Writer;
import java.io.BufferedInputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.charset.Charset;
@joshcangit
joshcangit / folder-import.php
Last active Nov 26, 2021
Import .sql database files from a folder into Adminer.
View folder-import.php
<?php
/**
* Import SQL files from a directory
*
* @author joshcangit, https://github.com/joshcangit
* @author Roy-Orbison, https://github.com/Roy-Orbison
*/
class AdminerImportFromFolder {
@joshcangit
joshcangit / disable-gnome-extensions.sh
Last active Jan 8, 2022 — forked from nicfit/disable-gnome-extensions.sh
Disable all gnome-shell extensions from command line.
View disable-gnome-extensions.sh
for ext in $($(type -P ls) ~/.local/share/gnome-shell/extensions); do
gnome-extensions disable $ext;
done
@joshcangit
joshcangit / ninja-install.sh
Created May 12, 2022
Script to download and or update ninja build tool
View ninja-install.sh
#!/bin/sh
DIR=$(dirname $(realpath $0))
folder_uid=$(id -u $(find "${DIR}" -maxdepth 0 -printf '%u\n'))
[ "${folder_uid}" -eq 0 ] && [ "$(id -u)" -ne "${folder_uid}" ] && sudo="sudo "
latest_version() {
local RELEASE="https://github.com/ninja-build/ninja/releases/latest"
case "$CMD" in
*xh*) xh $RELEASE --no-check-status -h | awk '/^location:/{print $2}' | awk -F/ '{print $NF}';;
*curl*) curl -ISs $RELEASE | awk '/^location:/{print $2}' | awk -F/ '{print $NF}';;
@joshcangit
joshcangit / meson.py
Last active May 13, 2022
Wrapper script for meson.pyz
View meson.py
#!/usr/bin/env python3
from asyncio import run as arun
from functools import partial as fpartial
from importlib import util as libutil
from pathlib import Path
from re import findall, sub
from shutil import move, which
from subprocess import run, PIPE, STDOUT
from sys import argv, stdout
from tarfile import open as topen