Skip to content

Instantly share code, notes, and snippets.

#隐藏或者开启一个应用在 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
@bramblex
bramblex / appify.sh
Created October 12, 2017 06:43 — forked from oubiwann/appify.sh
appify — create the simplest possible Mac app from a shell script (adds an application icon)
#!/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 {
@bramblex
bramblex / appify.sh
Last active October 12, 2017 05:50 — forked from anonymous/appify.sh
#!/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;
// ==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==
template <class T, class E>
union ResultContent {
T data;
E error;
};
template<class T = bool, class E = bool>
struct Result {
protected:
bool ok;
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;
@bramblex
bramblex / open-termianl.txt
Last active September 15, 2017 01:36
open terminal
//osx
osascript -e 'tell application "Terminal" to do script "yes"'
//windows
start cmd /k echo Hello, World!
// linux
// 一些方便用的函数库
#ifndef GAME_ENGINE_UTILS_HPP
#define GAME_ENGINE_UTILS_HPP
#include <iostream>
#include <vector>
#include <functional>
#include <map>
#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>>;
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