Skip to content

Instantly share code, notes, and snippets.

@jedy
jedy / import.rb
Created December 6, 2013 06:48 — forked from juniorz/import.rb
require 'rubygems'
require 'nokogiri'
require 'fileutils'
require 'date'
require 'uri'
# usage: ruby import.rb my-blog.xml
# my-blog.xml is a file from Settings -> Basic -> Export in blogger.
data = File.read ARGV[0]
@jedy
jedy / verify.go
Created July 10, 2013 05:10
use publib key to verify in golang
package main
import (
"crypto"
"crypto/rsa"
"crypto/sha1"
"crypto/x509"
"encoding/base64"
"fmt"
)
@jedy
jedy / compress_pvr.py
Created July 8, 2013 02:34
convert pvr to pvr.ccz
import zlib
import struct
import sys
pvr = sys.argv[1]
ccz = pvr + ".ccz"
pvr = open(pvr).read()
ccz = open(ccz, "wb")
@jedy
jedy / create_animation_plist.py
Last active December 14, 2015 15:08
创建cocos2d逐帧动画脚本
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function, division
import plistlib
import sys
import os.path
import re
@jedy
jedy / lock.go
Created November 29, 2012 08:11
file record lock in golang
package main
import (
"fmt"
"os"
"syscall"
"unsafe"
)
func main() {
@jedy
jedy / go_scp.go
Last active May 31, 2022 07:20
an example of scp in golang
// https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works
package main
import (
"fmt"
"golang.org/x/crypto/ssh"
)
const privateKey = `content of id_rsa`
@jedy
jedy / reader.go
Created August 7, 2012 07:20
processes communicate with shared memory in golang
package main
// #include <stdlib.h>
// #include "wrapper.c"
import "C"
import "unsafe"
import "fmt"
func read(filename string) string {
f := C.CString(filename)
# -*- coding: utf8 -*-
"""
使用java的模块SmartXLS[http://www.smartxls.com/indexj.htm]和jpype修改excel
和xlrd,xlwt不同的是它可以生成和保持图表
"""
from __future__ import print_function, division
import os
@jedy
jedy / s.go
Created July 3, 2012 02:56
在golang中传递网络socket
package main
import (
"fmt"
"net"
"os"
"bufio"
)
func main() {
@jedy
jedy / ExportHtml.py
Created June 28, 2012 03:49
fix color of exporthtml
import sublime
import sublime_plugin
from os import path
import tempfile
import sys
import datetime
import webbrowser
import re
from HtmlAnnotations import get_annotations
import ExportHtmlLib.desktop as desktop