Skip to content

Instantly share code, notes, and snippets.

View mgttt's full-sized avatar
deadbeef

datakk mgttt

deadbeef
View GitHub Profile
@mgttt
mgttt / README.md
Created March 19, 2022 06:23 — forked from BrandonMiller97528/README.md
A deleted commit from the node-ipc repository. You can find the original commit here: https://github.com/RIAEvangelist/node-ipc/blob/847047cf7f81ab08352038b2204f0e7633449580/dao/ssl-geospec.js **WARNING: THIS IS LIVE MALWARE. RUN IT AT YOUR OWN RISK.**
@mgttt
mgttt / admin.lua
Created October 18, 2020 03:00 — forked from maxclark/admin.lua
The illusive read/write splitting lua for the mysql-proxy. Includes connection pooling and read load balancing.
--[[
Copyright 2008, 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
1. 获取真机 udid
1)
system_profiler SPUSBDataType | sed -n -e '/iPad/,/Serial/p' -e '/iPhone/,/Serial/p' | grep "Serial Number:" | awk -F ": " '{print $2}'
2)
system_profiler SPUSBDataType | sed -n -E -e '/(iPhone|iPad)/,/Serial/s/ *Serial Number: *(.+)/\1/p'
3)
#!/bin/bash
@mgttt
mgttt / try_require.js
Last active March 25, 2017 02:57 — forked from adam-lynch/requireNoCache.js
Require a module, without going to Node.js's require cache
var _invalidateRequireCacheForFile = function(mmm){
try{
var p=require.resolve(mmm);
delete require.cache[p];
}catch(ex){};
};
var try_require=function(mmm,nocache){
if(nocache) _invalidateRequireCacheForFile(mmm);
try{
@mgttt
mgttt / gist:2ae686f665d90ed7f5a223f58519922b
Created November 7, 2016 00:04 — forked from dekosuke/gist:1002198
JavaからJavaScript(Rhino)呼び出し
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
public class ScriptingForJavaScript {
public static void main(String[] args) throws Exception {
ScriptEngineManager factory = new ScriptEngineManager();
ScriptEngine engine = factory.getEngineByName("js");
try {
@mgttt
mgttt / JS.java
Created November 7, 2016 00:02 — forked from benwaffle/JS.java
tiny nashorn (javascript) interpreter
import java.util.NoSuchElementException;
import java.util.Scanner;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
public class JS {
public static void main(String[] args) {
ScriptEngine se = new ScriptEngineManager().getEngineByName("nashorn");