Skip to content

Instantly share code, notes, and snippets.

@panfu
panfu / BalsamiqForever.py
Created December 20, 2023 08:04 — forked from HoussemNasri/BalsamiqForever.py
Extend your trial period for Balsamiq Wireframes on Windows and macOS Forever!
import json
import os
import time
import webbrowser
import sys
import re
def handleWindows(extra_seconds):
print("OS : Windows")
set theDMG to choose file with prompt "Please select javaforosx.dmg:" of type {"dmg"}
do shell script "hdiutil mount " & quoted form of POSIX path of theDMG
do shell script "pkgutil --expand /Volumes/Java\\ for\\ macOS\\ 2017-001/JavaForOSX.pkg ~/tmp"
do shell script "hdiutil unmount /Volumes/Java\\ for\\ macOS\\ 2017-001/"
do shell script "sed -i '' 's/return false/return true/g' ~/tmp/Distribution"
do shell script "pkgutil --flatten ~/tmp ~/Desktop/Java.pkg"
do shell script "rm -rf ~/tmp"
display dialog "Modified Java.pkg saved on desktop" buttons {"Ok"}
@panfu
panfu / pdfkit.test.js
Created June 6, 2017 02:03
sample for pdfkit usage
var PDFDocument = require('pdfkit')
const fs = require('fs');
var doc = new PDFDocument
doc.image('images/qrc_1000.png', 20, 15, {width: 100}).text('Proportional to width', 0, 0)
doc.image('images/qrc_1000.png', 220, 15, {width: 100}).text('Proportional to width', 0, 0)
doc.image('images/qrc_1000.png', 320, 15, {width: 100}).text('Proportional to width', 0, 0)
@panfu
panfu / create_qr.rb
Last active April 19, 2016 02:18
批量创建微信公众号二维码
require 'rubygems'
require "json"
require 'cgi'
require 'http'
APPID = '--------------'
SECRET = '--------------------------------'
def get_token
token_url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=#{APPID}&secret=#{SECRET}"
@panfu
panfu / .jshintrc
Last active August 29, 2015 14:27 — forked from haschek/.jshintrc
JSHint Configuration, Strict Edition
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true
@panfu
panfu / variables_case.js
Last active September 6, 2015 02:40
变量名称大小写之争,此处明了。
##### 变量大小写的结论
* 构造器 Class、Object 用 TheSomeone // 先祖的权威
* 方法名称 doSomething // 动宾,够醒目
* 文件名称 the_file // 网络传输可能会忽略大小写、可读性
* 普通变量 some_variables // 可读性
* CSS class: the-class-name
* CSS id: the_some_one
https://autoproxy-gfwlist.googlecode.com/svn/trunk/gfwlist.txt
@panfu
panfu / weibo_ads_killer.js
Created December 29, 2011 07:32
weibo广告杀手,适用于Chrome。
// ==UserScript==
// @name 铲除一切害人虫
// @description 移除我想移除,留下我想留下
// @match http://weibo.com/*
// @match http://*.weibo.com/*
// @match http://t.sina.com.cn/*
// @version 1.0
// ==/UserScript==
// 在这里添加你想要去掉的dom的id
crypto = require('crypto')
md5_url = (url) -> crypto.createHash('md5').update(url).digest("hex")[0..6]
h = {}
a = []
for r in [1..100000]
z = md5_url(Math.random() + '')
if !h[z]
a.push z
h[z] = 1
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>COLORFUL</title>
<script src="/jquery-1.js" type="text/javascript" charset="utf-8"></script>
<script src="/modernizr.js" type="text/javascript" charset="utf-8"></script>
<script src="/mustache.js" type="text/javascript" charset="utf-8"></script>
<script>