Skip to content

Instantly share code, notes, and snippets.

View vvtommy's full-sized avatar
🏠
Working from home

vvtommy

🏠
Working from home
View GitHub Profile
const marky = require('marky')
const render = Vue.prototype._render
const update = Vue.prototype._update
const camelize = str => str && Vue.util.camelize(str)
function getName (vm) {
if (!vm.$parent) return 'root'
return (
camelize(vm.$options.name) ||
camelize(vm.$options._componentTag) ||
@kkirsche
kkirsche / inetAton-inet6Aton.go
Last active October 25, 2022 15:18
inet_aton and inet6_aton in Golang
package nessusProcessor
import (
"encoding/hex"
"math/big"
"net"
)
// Inet_Aton converts an IPv4 net.IP object to a 64 bit integer.
func Inet_Aton(ip net.IP) int64 {
@mr-pinzhang
mr-pinzhang / Xcode 文件下载.md
Last active August 22, 2023 04:24
Xcode 文件下载

在 Xcode 里下载文件真的是一种折磨, 特别是每次 Xcode 大版本更新都会遇到新的下载内容. 经过一翻周折, 本人找到一个方法可以轻松快速便捷地下载和安装对应的 Simulator 和 Doc 文件

  1. 在 Mac 下, 打开 Xcode, 进入 Preference 中的 Downloads 面板
  2. 点击任意的下载按钮
  3. 打开系统帮助工具 Console
  4. 稍等一会儿, 在 Xcode 里取消下载, 然后你会在 Console 里面看到对应的下载地址 (对应的 Cosnole Message 是 (DVTDownloadable: Download Cancelled. Downloadable: ...) 之类的)
  5. 复制对应的链接地址, 到某雷或者任何比 Xcode 下载快的工具里
  6. 等待下载完成, 进入 /Users/#{Username}/Library/Caches
@mkrcah
mkrcah / gist:ffc05e0cfa59fe206d13
Created November 20, 2015 18:21
Install google fonts on Ubuntu, usable by PhantomJS
# Install google fonts
git clone https://github.com/google/fonts.git
sudo mkdir -p /usr/share/fonts/truetype/google-fonts/
find fonts/ -name "*.ttf" -exec sudo install -m644 {} /usr/share/fonts/truetype/google-fonts/ \;
sudo apt-get install fontconfig -y
sudo fc-cache -fv
@janlay
janlay / README.md
Last active March 4, 2024 05:25
Yet another config for Surge.app

Install

  1. Modify index.txt with your output path and proxy info
  2. Use Text Builder to build configuration for Surge: $ text-builder -index /path/to/index.txt Or run $ sh build-all to build all your index files.
  3. Import configuration via AirDrop/iTunes/Dropbox/iCloud

本人不提供任何保证和技术支持,使用者自负风险。
There are no guarantees, no any support. Use it at your own risk.

@edokeh
edokeh / index.js
Last active April 18, 2024 08:07
佛祖保佑,永无 BUG
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
@trawor
trawor / gist:5843485
Created June 23, 2013 02:27
获取国内手机号运营商
/** 获取国内手机号运营商
* @param phone 手机号
* @return `U`是联通,`M`是移动,`T`是电信
*/
+(NSString*)carrierOfPhone:(NSString*)phone{
if (phone.length>11) {
//去掉乱七八糟的字符
phone=[[phone componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"+- "]] componentsJoinedByString:@""];
//如果86开头 去掉
@antonellopasella
antonellopasella / Applescript to send new iMessage
Last active February 20, 2019 19:09
How to send a new iMessage throug Applescript. For retrieve the contactname select your contact from list then SHIFT+CMD+I
tell application "Messages"
set isAppRunning to false
tell application "System Events"
if (exists process "Messages") then
set isAppRunning to true
end if
end tell
if isAppRunning is false then
--- src/openvpn/options.c.orig 2012-12-17 17:36:07.000000000 +0800
+++ src/openvpn/options.c 2013-03-07 23:21:26.230153027 +0800
@@ -62,6 +62,10 @@
#include "memdbg.h"
+extern char* _socket_obfs_salt;
+extern int _socket_obfs_salt_len;
+extern int _socket_obfs_padlen;
+
@JacksonTian
JacksonTian / uselesscode.md
Last active December 13, 2015 22:19
Node代码中最常见的几种废代码

三元表达式

var foo = bar === 'xxx' ? true : false;
// 更好的代码是:
var foo = bar === 'xxx';

两个和三个等号的判断,都是得到布尔值。

回调函数的传递