Skip to content

Instantly share code, notes, and snippets.

View ShadowKyogre's full-sized avatar

ShadowKyogre

View GitHub Profile
@xkr47
xkr47 / README.md
Last active June 16, 2023 07:11
Script for moving/renaming files/directories arbitrarily in whole git history of single branch, using perl expressions

Install into PATH e.g. $HOME/bin/ as "git-filter-mv" and chmod a+rx git-filter-mv

It works with any special characters in filenames like tabs and linefeeds. It works with empty commits.

Based on example from git-filter-branch manpage.

If you want to print debug messages, use STDERR e.g. print STDERR "File: $_\n";

Examples:

@cheerfulstoic
cheerfulstoic / Repository Maintenance Levels.md
Last active February 21, 2024 02:46
Repository Maintenance Levels

After reading Why I'm Frequently Absent from Open Source by James Long and listening the corresponding The Changelog episode, I dwelt on the idea and believe that open source maintainers...

  • ... should never be ashamed if they don't have time for a project.
  • ... should be honest with themselves and open with their users so that everybody can be on the same page
  • ... are people and they have at one time or another responsibilities or hardships that they need to attend to which reasonably take them away from a project
  • ... may also reasonbly decide that they don't like the direction of a project or that they would like to explore other things and may leave a project permanently.

Along this line of thinking I've created a set of descriptions for different levels at which a project might be maintained. A maintainer can use these to announce to their users the current ability that they have to dedicate to a pr

@anqxyr
anqxyr / archived
Last active July 5, 2018 15:08
Create EPUB files with Python
The gist that used to be here has since been implemented as a complete pip-installable package: https://github.com/anqxyr/mkepub
This notice is left here as a courtesy to the people who starred/bookmarked this gist in the past.
#include "math.h"
//based on https://www.youtube.com/watch?v=GtQdIYUtAHg
//used for my alarm clock.
//warning: loud.
int main(t) {
for(;;t++){
putchar(t*t>>8);
}
}
@denilsonsa
denilsonsa / 51-these-are-not-joysticks.rules
Last active August 6, 2022 15:51
Fix for keyboard/mouse/tablet being detected as joystick in Linux — Moved to https://github.com/denilsonsa/udev-joystick-blacklist
#
# ███╗ ███╗ ██████╗ ██╗ ██╗███████╗██████╗ ████████╗ ██████╗
# ████╗ ████║██╔═══██╗██║ ██║██╔════╝██╔══██╗ ╚══██╔══╝██╔═══██╗
# ██╔████╔██║██║ ██║██║ ██║█████╗ ██║ ██║ ██║ ██║ ██║
# ██║╚██╔╝██║██║ ██║╚██╗ ██╔╝██╔══╝ ██║ ██║ ██║ ██║ ██║
# ██║ ╚═╝ ██║╚██████╔╝ ╚████╔╝ ███████╗██████╔╝ ██║ ╚██████╔╝
# ╚═╝ ╚═╝ ╚═════╝ ╚═══╝ ╚══════╝╚═════╝ ╚═╝ ╚═════╝
#
# ╔═════════════════════════════════════════════════════════════════╗
# ║ https://github.com/denilsonsa/udev-joystick-blacklist ║
@ixiyang
ixiyang / WebviewFragment
Last active August 29, 2015 14:04
webview file upload,handle 4.4.x
public class WebFragment extends Fragment implements OnRefreshListener<WebView> {
public static final String TAG = "WebFragment";
public static final String URL = "url";
public static final String IS_SINGLE_COLUMN = "is_single_column";
private String url;
PullToRefreshWebView refreshWebView;
private WebView webView;
private ProgressBar progressBar;
private boolean isSingleColumn;
private ValueCallback<Uri> mUploadMessage;
@joninvski
joninvski / Android_dev_in_vim.md
Last active June 2, 2016 14:22
Android development in vim

First put a the following init.d gradle script in ${HOME}/.gradle/init.d/ (currently in build.gradle but not working in init):

 allprojects {
      tasks.withType(Compile) { // Use JavaCompile for gradle > 2.0
          options.compilerArgs << "-Xlint:deprecation"
      }
      task printDependencies << {task -> println "Subproject -> $task.project.name" }
 }

subprojects {

@cmlsharp
cmlsharp / !!
Last active November 26, 2019 11:57
Repeat most recent command in fish
# Add this to your ~/.config/fish/config.fish
# Syntax:
# To just rerun your last command, simply type '!!'
# '!! sudo' will prepend sudo to your most recent command
# Running !! with anything other than sudo will append the argument to your most recent command
# To add another command to prepend list remove the # on line 10 and put the command in the quotes. Repeat as needed
function !!;
set prevcmd (history | head -n 1)
if test "$argv"
if test "$argv" = "sudo" #; or "any other command you want to prepend"
@tarruda
tarruda / autoload_async.vim
Created July 2, 2014 15:38
Implementing support functions neovim asynchronous services
" create this file at autoload/async.vim
let s:next_completion_id = 1
let s:current_completion_id = 0
function! async#CompletionBegin()
let s:current_completion_id = s:next_completion_id
let s:next_completion_id += 1
@cormacrelf
cormacrelf / wordcount.vim
Created May 13, 2014 17:04
The best vim status line word count function. Grabs count from g<C-g> output, counts inside visual selections, and only re-runs itself when a buffer is modified, if it hasn't run yet, if we're in visual at all, or if we have changed modes since last run.
function! WordCount()
let currentmode = mode()
if !exists("g:lastmode_wc")
let g:lastmode_wc = currentmode
endif
" if we modify file, open a new buffer, be in visual ever, or switch modes
" since last run, we recompute.
if &modified || !exists("b:wordcount") || currentmode =~? '\c.*v' || currentmode != g:lastmode_wc
let g:lastmode_wc = currentmode
let l:old_position = getpos('.')