This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#隐藏或者开启一个应用在 docker 上的图标 | |
/usr/libexec/PlistBuddy -c "Add :LSUIElement bool true" /Applications/iTerm.app/Contents/Info.plist | |
/usr/libexec/PlistBuddy -c "Delete :LSUIElement" /Applications/iTerm.app/Contents/Info.plist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
VERSION=4.0.1 | |
SCRIPT=`basename "$0"` | |
APPNAME="My App" | |
APPICONS="/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericApplicationIcon.icns" | |
OSX_VERSION=`sw_vers -productVersion` | |
PWD=`pwd` | |
function usage { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# appify your-shell-script.sh "Your App Name" | |
# https://mathiasbynens.be/notes/shell-script-mac-apps | |
APPNAME=${2:-$(basename "${1}" '.sh')}; | |
DIR="${APPNAME}.app/Contents/MacOS"; | |
if [ -a "${APPNAME}.app" ]; then | |
echo "${PWD}/${APPNAME}.app already exists :("; | |
exit 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name fuck网易 | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match http://mc.netease.com/* | |
// @grant none | |
// @require http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <class T, class E> | |
union ResultContent { | |
T data; | |
E error; | |
}; | |
template<class T = bool, class E = bool> | |
struct Result { | |
protected: | |
bool ok; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <class T> | |
struct Segment { | |
private: | |
unsigned long start; | |
unsigned long _size; | |
std::vector<T>* content; | |
public: | |
Segment(std::vector<T> &content){ | |
this->content = &content; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//osx | |
osascript -e 'tell application "Terminal" to do script "yes"' | |
//windows | |
start cmd /k echo Hello, World! | |
// linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 一些方便用的函数库 | |
#ifndef GAME_ENGINE_UTILS_HPP | |
#define GAME_ENGINE_UTILS_HPP | |
#include <iostream> | |
#include <vector> | |
#include <functional> | |
#include <map> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <map> | |
#include <functional> | |
typedef unsigned long ListenerID; | |
template <class EventData> | |
using Listener = std::function<void(EventData)>; | |
template <class EventData> | |
using ListenersMap = std::map<ListenerID, Listener<EventData>>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] | |
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,3a,00,46,00,01,00,3a,00,00,00,00,00 |