Skip to content

Instantly share code, notes, and snippets.

@hongjiang
hongjiang / vpn.sh
Last active October 27, 2015 10:21
mac vpn connection script
#!/bin/bash
PROG_NAME=$0
ACTION=$1
usage() {
echo "Usage: $PROG_NAME {list|ping|optimal|conn|close|status}"
exit 1
}
@rfharmon
rfharmon / Ad Optimizer: Get Ads.js
Last active April 10, 2017 12:17
This MCC script will find ads in your accounts that are ready for optimization (based on CTR). It will send the winning ad copy to a spreadsheet where you can create variations. Then you can run a separate script to post those variations.
// This MCC script will find ads in your accounts that are ready for optimization.
// It will pause lower performing ads, and send the copy from the higher performing
// ad to a spreadsheet.
//
// There, you can tweak the copy or URLs. Then you can run the "Post Ad" script to post the
// variations to your accounts. The script will also find ad groups with only one ad and send
// that ad to the spreadsheet so that you can create a variation of it.
//
// In the spreadsheet, the "Notes" column will say "Better" (if the ad was better than the other)
// "Close" (if it was too close to call), or "Only" (if there was only one ad in the ad group).
@rfharmon
rfharmon / Ad Optimizer: Post Ads.js
Last active April 11, 2017 08:52
This MCC script will create new ads based on a spreadsheet.
// This script will create ads based on the copy in your spreadsheet
// and label them "Optimized".
var SPREADSHEET_URL = "[INSERT-URL-HERE]";
var spreadsheet = SpreadsheetApp.openByUrl(SPREADSHEET_URL);
// This script will delete the rows as it posts the ads, if you set CREATE_BACKUP
// to "true", it will copy the original sheet before deleting rows.
var CREATE_BACKUP = true;
anonymous
anonymous / shadowsocks_tor_zeronet
Created November 20, 2016 12:18
Shadowsocks 作为前置代理,通过 Tor 匿名使用 ZeroNet(备忘)
# 声明:此备忘只供参考,并非权威方法,请参阅 Tor 和 ZeroNet 的安装和配置手册
# Tor 相关 FAQ 见 http://*.*.*.*:43110/gfwtalk.bit/?Topic:37_13Z7XxTa7JuFat3KzzMWu3onwM6biLuurJ/+FAQ+6+1+Update+Freenet+VPS+ZeroNet+com+bit
# ZeroNet 集成的 Tor 版本并没有及时更新,现在最新版是 0.2.9.x
# 适用 Debian/Ubuntu/raspberryPi 等系统
# 按照 Tor 官方文档安装最新版 Tor https://www.torproject.org/docs/debian.html.en#ubuntu
# 墙内使用 Tor 需要前置代理,推荐使用 Shadowsocks 作为前置代理,默认本地代理端口 1080
# Tor 和 Shadowsocks 准备就绪后修改 /etc/tor/torrc 文件
vi /etc/tor/torrc
@dongweiming
dongweiming / send_message.py
Last active December 18, 2018 06:49
send_message.py
# coding=utf-8
# pip install zhihu_oauth
import os
import time
import json
# -*- coding=utf-8 -*-
import Queue
import functools
import logging
import os
import re
import sys
import time
from functools import partial
from itertools import repeat
@BrainlabsDigital
BrainlabsDigital / Check If You've Screwed Up Your AdWords Account.js
Last active May 3, 2019 01:24
Script to check keyword and ad text for basic errors or out-of-date messaging.
/**
*
* AdWords Script for keyword and ad checking.
* Checks keyword text for punctuation suggesting the wrong match type, checks
* broad match keywords for missing BMM. Checks ad text for text that suggests
* ads are out-of-date (like previous years) and for common English spelling
* mistakes.
*
* Version: 1.1
* Updated 2017-01-05: changed 'CreativeApprovalStatus' to 'CombinedApprovalStatus'
@tdoly
tdoly / v2ex_auto_login.py
Last active May 24, 2019 13:28
v2ex 自动登录,领取金币脚本
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
import logging
import datetime
import requests
import BeautifulSoup
from requests.adapters import HTTPAdapter
Install Homebrew OS X package manager:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install ffmpeg with x265 support:
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libquvi --with-libvorbis --with-libvpx --with-opus --with-x265
Convert video to x265:
ffmpeg -i input -c:v libx265 -preset medium -crf 28 -c:a aac -b:a 128k output.mp4
Uninstall ffmpeg:
@BrainlabsDigital
BrainlabsDigital / Hourly Email Updates
Last active January 12, 2021 00:07
Script to email you hourly with the cost/performance so far today.
/**
*
* Hourly Email Updates
*
* This script emails you every hour with totals for selected performance metrics (like cost)
* for your account for the day so far.
*
* Version: 1.1
* Updated 2016-10-11: removed 'ConvertedClicks'
* Google AdWords Script maintained on brainlabsdigital.com