Navigation Menu

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}"
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>
url\(\"(.*?)/(\w+.png)\"\) #=> url("../images/$2")
# This is probably because you have a too recent version of bundler installed. Integrity v22 is not compatible with bundler > 0.9, but relies on functionality that was in removed in the subsequent version. In my case I installed bundler 0.9 before I ran bundle install:
gem install bundler --version=0.9