This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'nokogiri' | |
require 'fileutils' | |
require 'date' | |
require 'uri' | |
# usage: ruby bimport_blog.rb blog_kamu.xml | |
data = File.read ARGV[0] | |
doc = Nokogiri::XML(data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
tinymce.init({ | |
selector: "textarea", | |
theme: "modern", | |
plugins: [ | |
"advlist autolink lists link image charmap print preview hr anchor pagebreak", | |
"searchreplace wordcount visualblocks visualchars code fullscreen", | |
"insertdatetime media nonbreaking save table contextmenu directionality", | |
"emoticons template paste textcolor" | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Check AWB</title> | |
<style type="text/css"> | |
BODY, TD, INPUT { | |
font-family:Geneva, Arial, Helvetica, sans-serif; | |
font-size: 12px; | |
} | |
INPUT.submit { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div data-theme="light" id="rajaongkir-widget"></div> | |
<script type="text/javascript" src="//rajaongkir.com/script/widget.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$yahooID = "YOUR_ID"; | |
$status = file_get_contents("http://opi.yahoo.com/online?u=".$yahooID."&m=a&t=1"); | |
if ($status === '00') { | |
echo "OFFLINE!"; | |
} else if ($status === '01') { | |
echo "ONLINE!"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
require 'fileutils' | |
require 'date' | |
require 'yaml' | |
require 'uri' | |
require 'rexml/document' | |
include REXML | |
doc = Document.new File.new(ARGV[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#app/controllers/application_controller.rb | |
class ApplicationController < ActionController::Base | |
def opensearch | |
response.headers['Content-Type'] = 'application/opensearchdescription+xml; charset=utf-8' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AuthenticationsController < ApplicationController | |
# This is the callback method from OmniAuth's GitHub authentication. | |
# following http://railscasts.com/episodes/236-omniauth-part-2 | |
def create | |
omniauth = request.env["omniauth.auth"] | |
authentication = Authentication.find_by_provider_and_uid(omniauth['provider'], omniauth['uid']) | |
if authentication | |
sign_in_and_redirect(:user, authentication.user) | |
end | |
OlderNewer