Skip to content

Instantly share code, notes, and snippets.

View firemaples's full-sized avatar
🇯🇵
Relocated to Japan

Louis Chen firemaples

🇯🇵
Relocated to Japan
View GitHub Profile
// ==UserScript==
// @name VaRe Form Helper
// @namespace https://VaReFormHelper.firemaples.com/
// @version 0.3
// @description try to take over the world!
// @author Firemaples
// @match *://*/*reg.*th.*g.*.html
// @match https://*/*19*a*es*ue/
// @icon https://www.google.com/s2/favicons?domain=undefined.
// @grant none
@firemaples
firemaples / PhonecallReceiver.java
Created June 11, 2021 10:10 — forked from ftvs/PhonecallReceiver.java
Detecting an incoming call coming to an Android device. Remember to set the appropriate permissions in AndroidManifest.xml as suggested in the Stackoverflow link. Usage example in comments. Source: Gabe Sechan http://stackoverflow.com/a/15564021/264619 Explanation: http://gabesechansoftware.com/is-the-phone-ringing/#more-8
package com.gabesechan.android.reusable.receivers;
import java.util.Date;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
public abstract class PhonecallReceiver extends BroadcastReceiver {
@firemaples
firemaples / RedmineHelper.user.js
Last active July 30, 2021 01:26
Utilities for redmine
// ==UserScript==
// @name Redmine Helper
// @namespace http://RedmineHelper.firemaples.com/
// @version 0.8
// @description Utilities for redmine issues.
// @author Firemaples
// @homepage https://gist.github.com/firemaples/d8df3e66da2a26e0c8aa924e2af0208f
// @match *://*/issues/*
// @include *://redmine.*/issues/*
// @grant none
@firemaples
firemaples / KibanaColumnNameSimplifier.user.js
Last active October 23, 2019 05:23
Simplify the column name in Kibana
// ==UserScript==
// @name Column name simplifier in Kibana
// @namespace http://KibanaSimplifier.firemaples.com/
// @version 0.4
// @description Simplify the column name in Kibana.
// @author Firemaples
// @homepage https://gist.github.com/firemaples/f7fda51d4d459338c4e566e20a162796/
// @match */app/kibana
// @grant none
// @downloadUrl https://gist.github.com/firemaples/f7fda51d4d459338c4e566e20a162796/raw/KibanaColumnNameSimplifier.user.js
@firemaples
firemaples / iterm2-solarized.md
Created June 21, 2018 09:27 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@firemaples
firemaples / revert-a-commit.md
Created April 26, 2018 04:11 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}'

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@firemaples
firemaples / flavor_names_build.gradle
Created January 31, 2017 12:08 — forked from keyboardsurfer/flavor_names_build.gradle
Version names for application variants
android {
applicationVariants.all { variant ->
def flavor = variant.mergedFlavor
def name = flavor.getVersionName()
def versionName = name + '-' + variant.properties.get('flavorName')
if (variant.buildType.isDebuggable()) {
versionName += '-debug';
}
flavor.versionName = versionName;
}
@firemaples
firemaples / visor-archivos-online.md
Created February 16, 2016 03:45 — forked from izazueta/visor-archivos-online.md
Google Docs Viewer & Office Web Apps Viewer

Google Docs Viewer

Only files under 25 MB can be previewed with the Google Drive viewer.

Google Drive viewer helps you preview over 16 different file types, listed below:

  • Image files (.JPEG, .PNG, .GIF, .TIFF, .BMP)
  • Video files (WebM, .MPEG4, .3GPP, .MOV, .AVI, .MPEGPS, .WMV, .FLV)
  • Text files (.TXT)
  • Markup/Code (.CSS, .HTML, .PHP, .C, .CPP, .H, .HPP, .JS)
  • Microsoft Word (.DOC and .DOCX)
@firemaples
firemaples / InstallClickOnceApp.cs
Created November 18, 2015 06:51 — forked from josheinstein/InstallClickOnceApp.cs
Install ClickOnce application programmatically (C#)
using System;
using System.Collections.Generic;
using System.Deployment.Application;
using System.Linq;
using System.Text;
using System.Threading;
namespace InstallClickOnceApp
{
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>App Redirection</title>
</head>
<body>
<!-- iframe used for attempting to load a custom protocol -->
<iframe style="display:none" height="0" width="0" id="loader"></iframe>