Skip to content

Instantly share code, notes, and snippets.

View DrayChou's full-sized avatar
😸

Dray DrayChou

😸
View GitHub Profile
@stammy
stammy / wordpress_importer.rb
Last active March 27, 2022 09:39
Import a WordPress database and generate markdown files for Jekyll
# View my Jekyll blog http://paulstamatiou.com and my jekyll migration post http://paulstamatiou.com/how-to-wordpress-to-jekyll/
#
#
# based on the import script by icebreaker, which is based on mojombo's
# https://github.com/mojombo/jekyll/blob/master/lib/jekyll/migrators/wordpress.rb
# https://gist.github.com/303570
# edited to rewrite image URLs to use my CloudFront URL
require 'rubygems'
require 'sequel'
# This is derived version of https://github.com/mojombo/jekyll/blob/master/lib/jekyll/migrators/wordpress.rb
$KCODE='UTF8'
require 'rubygems'
require 'sequel'
require 'fileutils'
require 'yaml'
require 'ya2yaml'
module Jekyll
@jcsrb
jcsrb / gist:1081548
Created July 13, 2011 23:05
get avatar from google profiles, facebook, gravatar, twitter, tumblr
function get_avatar_from_service(service, userid, size) {
// this return the url that redirects to the according user image/avatar/profile picture
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px )
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word )
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px )
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word )
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px )
// everything else will go to the fallback
// google and gravatar scale the avatar to any site, others will guided to the next best version
@xdite
xdite / gist:1273518
Created October 9, 2011 10:07
Octopress Wordpress converter
require 'fileutils'
require 'date'
require 'yaml'
require 'rexml/document'
require 'ya2yaml'
include REXML
doc = Document.new(File.new(ARGV[0]))
@ikbear
ikbear / gist:1274521
Created October 10, 2011 02:36 — forked from xdite/gist:1273518
Octopress Wordpress converter
require 'fileutils'
require 'date'
require 'yaml'
require 'rexml/document'
require 'ya2yaml'
include REXML
doc = Document.new(File.new(ARGV[0]))
@yorkxin
yorkxin / wordpressdotcom.rb
Created November 25, 2011 18:29
Wordpress.com (XML export) to Octopress importer. See http://git.io/x8yapw for change notes.
# coding: utf-8
# Original File: https://github.com/mojombo/jekyll/blob/master/lib/jekyll/migrators/wordpress.rb
# Modified by Yu-Cheng Chuang <ducksteven@gmail.com>
# Licensed under MIT License (same as the original file)
# This version of wordpressdotcom.rb is compatible
# with the real-world Wordpress.com export file, which:
#
# - Makes paragraphs (<p>) and line breaks (<br>)
@zellux
zellux / migrate.rb
Created November 29, 2011 03:10
Migrate from wordpress to octopress
# coding: utf-8
require 'rubygems'
require 'hpricot'
require 'fileutils'
require 'time'
require 'ya2yaml'
require File.join(File.dirname(__FILE__), "downmark_it")
require 'nokogiri'
require 'cgi'
@daha
daha / README.md
Created May 18, 2012 10:03
User tweet downloader

Twitter user tweets downloader

This gist is basically a snapshot of my project twitter-viz on GitHub. My goals with this project is to:

  1. Play with the twitter API in javascript.
  2. Play a little with jQuery, css-selectors and effects.
  3. Try twitter bootstrap for the layout/formatting of the page.
@border
border / sina.go
Created September 3, 2012 07:06
goauth2 for sina weibo
// Copyright 2012 Jiang Bian (borderj@gmail.com). All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Email: borderj@gmail.com
// Blog: http://wifihack.net/
// Sina WeiBo oauth2 Login, Base on goauth2 lib
package main
@zolunx10
zolunx10 / .gitignore
Last active December 24, 2023 15:14
Rime用颜文字(及符号)字典. 个人都绑定到v键开头了, 请下载kaomoji*并酌情修改字典文件.dict.yaml; 另如果要在当前输入法中直接嵌入, 请参考luna_pinyin_simp.custom.yaml前半段修改您的输入法设置.
*
!.gitignore
!alternative.yaml
!*.custom.yaml
!kaomoji.*.yaml