Skip to content

Instantly share code, notes, and snippets.

View SunDi3yansyah's full-sized avatar
Verified

Cahyadi Triyansyah SunDi3yansyah

Verified
View GitHub Profile
@christiawaneko
christiawaneko / import_blog.rb
Last active August 29, 2015 14:06
cara import blogger ke octopress :)
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)
@hergipriyambodo
hergipriyambodo / dot js
Created January 14, 2015 09:00
Ojo lali di copy
<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"
],
@feryardiant
feryardiant / README.md
Last active January 21, 2016 14:33
Thue Morse Sequence - PHP Implementation

Thue Morse Sequence - PHP Implementation

Recently, I got a job vacancy test and this is the one of questions i've got. I'm absolutely new here so CMIIW 😉

Usage

Simply download the gist and create new file called whatever.php then copy-paste lines below:

!#/usr/bin/env php
@natali
natali / jne.php
Created September 9, 2012 13:48
Cek resi TIKI JNE/TIKI
<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 {
@hok00age
hok00age / RajaOngkir Widget Code
Last active May 28, 2016 19:20
Code untuk menambahkan widget pengecekan ongkos kirim
<div data-theme="light" id="rajaongkir-widget"></div>
<script type="text/javascript" src="//rajaongkir.com/script/widget.js"></script>
@gmaggio
gmaggio / yahoo-online-status-detection.php
Created July 8, 2014 11:42
[Yahoo] Yahoo Messenger Online/Offline Status Detection #soical-media
<?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!";
@tnmt
tnmt / wp-xml-octopress-import.rb
Created November 15, 2011 12:31
Import XML of Wordpress to Octopress
# -*- coding: utf-8 -*-
require 'fileutils'
require 'date'
require 'yaml'
require 'uri'
require 'rexml/document'
include REXML
doc = Document.new File.new(ARGV[0])
@fred
fred / application_controller.rb
Created April 29, 2012 07:20 — forked from skamithi/application_controller.rb
Adding Opensearch to my Rails 3.2 app
#app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
def opensearch
response.headers['Content-Type'] = 'application/opensearchdescription+xml; charset=utf-8'
end
@mattboldt
mattboldt / authentications_controller.rb
Last active April 21, 2017 16:59
OmniAuth & Octokit.
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