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
#!/bin/bash | |
# update_gfwlist.sh | |
# Author : VincentSit | |
# Copyright (c) http://xuexuefeng.com | |
# | |
# Example usage | |
# | |
# ./whatever-you-name-this.sh | |
# | |
# Task Scheduling (Optional) |
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
#!/bin/sh | |
INPUT_METHODS_DIR="/Library/Input Methods" | |
WETYPE_INSTALL_PATH="$INPUT_METHODS_DIR/WeType.app" | |
WXKB_INSTALL_PATH="$INPUT_METHODS_DIR/wxkbmac.app" | |
CUR_DIR=$(cd "$(dirname "$0")"; pwd) | |
echo "$(date +%H:%M:%S) kill WeType" | |
killall wxkbmac | |
#killall WeTypeFeedback |
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 <netinet/in.h> | |
#include <sys/socket.h> | |
#include <unistd.h> | |
#include <arpa/inet.h> | |
- (void)broadCast | |
{ | |
int socketSD = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); | |
if (socketSD <= 0) { | |
NSLog(@"Error: Could not open socket."); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>downloadables</key> | |
<array> | |
<dict> | |
<key>fileSize</key> | |
<integer>1171440164</integer> | |
<key>identifier</key> |
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
#!/bin/bash | |
for package in $(brew list) | |
do | |
# path=$(brew --cellar $package) | |
path="/usr/local/Cellar/$package" | |
# only the first match. | |
pkgdir=$(find $path -mindepth 1 -type d -name "pkgconfig" -print -quit 2> /dev/null) | |
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
#coding=utf-8 | |
import os | |
import sys | |
import shlex | |
import requests | |
from bs4 import BeautifulSoup | |
# 前置 | |
# 安装 you-get |
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
#!/bin/sh | |
# Example usage | |
# cd into directory that has @3x images | |
# ./whatever-you-name-this.sh | |
# Remember to chmod +x the script | |
resize () { | |
ls *@3x.png | awk '{print("convert "$1" -filter box -resize '$1' "$1)}' | sed 's/@3x/'$2'/2' | /bin/sh | |
} |
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
import com.google.gson.Gson | |
import com.google.gson.TypeAdapter | |
import com.google.gson.internal.LinkedTreeMap | |
import com.google.gson.stream.JsonReader | |
import com.google.gson.stream.JsonToken | |
import com.google.gson.stream.JsonWriter | |
import java.io.IOException | |
import java.util.* | |
class CustomizedObjectTypeAdapter : TypeAdapter<Any>() { |
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 python3 | |
# -*- coding: utf-8 -*- | |
from urllib import request | |
import json | |
import os | |
uid = 260732811 | |
access_token = '277504095.59c578a.6aed864be0794247a1c0318221b03d7b' | |
base_url = r'https://api.instagram.com/v1/users/%s/media/recent/?access_token=%s' % (uid, access_token) |
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
#!/bin/bash | |
# Author : VincentSit | |
# Copyright (c) http://xuexuefeng.com | |
# 批量 ping 云梯 VPN 服务器. | |
# 请将 example.com 替换为你的专属服务器地址. | |
HOSTS=("日本1号:jp1.example.com" | |
"日本2号:jp2.example.com" | |
"日本3号:jp3.example.com" |
NewerOlder