Skip to content

Instantly share code, notes, and snippets.

suffix="_nogps"
for f in "$@"
do
extension=${f##*.}
newfile="${f%.$extension}$suffix.$extension"
/usr/local/bin/exiftool -gps:all= -xmp:geotag= "$f" -o "$newfile"
done
@andyli
andyli / index.js
Last active August 11, 2020 16:05
telegraf-session-mysql bug causing a bot doesn't response after first reply
const express = require('express');
const Telegraf = require("telegraf");
const MySQLSession = require('telegraf-session-mysql');
const token = process.env.TGBOT_TOKEN;
const telegraf = new Telegraf(token);
const session = new MySQLSession({
host: process.env.MYSQL_ENDPOINT,
user: process.env.MYSQL_USER,
password: process.env.MYSQL_PASSWORD,
@andyli
andyli / keybase.md
Created March 18, 2019 19:16
keybase.md

Keybase proof

I hereby claim:

  • I am andyli on github.
  • I am andyli (https://keybase.io/andyli) on keybase.
  • I have a public key whose fingerprint is DF01 A922 9726 D0FA 42F7 5706 6DAC 3C44 8773 381A

To claim this, I am signing this object:

@andyli
andyli / IEMaxScriptStatements.bat
Created January 30, 2017 08:42
Sauce Labs: How to hide "Stop running this script?" dialogs
@echo off
reg add "HKCU\Software\Microsoft\Internet Explorer\Styles" /f
reg add "HKCU\Software\Microsoft\Internet Explorer\Styles" /v "MaxScriptStatements" /t REG_DWORD /d 0xFFFFFFFF /f
@andyli
andyli / keybase.md
Created July 14, 2016 18:19
keybase.md

Keybase proof

I hereby claim:

  • I am andyli on github.
  • I am andyli (https://keybase.io/andyli) on keybase.
  • I have a public key whose fingerprint is F575 267D E25B 1A5D 8835 75D6 D60F B02A C411 6C69

To claim this, I am signing this object:

Compiling homework.mzn
Running homework.mzn
A = 3;
B = 4;
C = 0;
D = 9;
E = 2;
F = 5;
G = 8;
H = 6;
@andyli
andyli / Test.hx
Created January 16, 2016 12:54
Demo extern of jQuery Impromptu
@:native("$.prompt")
extern class Impromptu {
@:selfCall // @:selfCall avoid generation of `new`
public function new(msg:Dynamic, ?options:Dynamic):Void;
static public function setDefaults(options:Dynamic):Void;
static public function open(states:Dynamic, ?options:Dynamic):Impromptu;
}
class Test {
@andyli
andyli / main.cpp
Created July 7, 2015 05:37
const char * a is NOT a pointer to immutable char
#include<iostream>
using namespace std;
int main(int argc, char** argv) {
char c = 'a';
const char * a = &c;
// *a = 'b'; // error: read-only variable is not assignable
cout << *a << endl; //a
c = 'b';
@andyli
andyli / cmd-arg.md
Last active August 29, 2015 14:16
Command line argument escaping
@andyli
andyli / Haxe.3.1.3.nuspec
Created January 26, 2015 18:24
Haxe Chocolatey package
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>haxe</id>
<version>3.1.3</version>
<title>Haxe</title>
<authors>Haxe Foundation</authors>
<licenseUrl>http://haxe.org/foundation/open-source.html</licenseUrl>
<projectUrl>http://haxe.org/</projectUrl>
<iconUrl>http://haxe.org/img/haxe-logo.svg</iconUrl>