Skip to content

Instantly share code, notes, and snippets.

View matematikaadit's full-sized avatar

Adit Cahya Ramadhan matematikaadit

View GitHub Profile
// ==UserScript==
// @name gist: replace title with filename
// @namespace http://d.hatena.ne.jp/youpy/
// @include http://gist.github.com/*
// @include https://gist.github.com/*
// @exclude http://gist.github.com/gists
// @exclude https://gist.github.com/gists
// @require https://gist.github.com/3242.txt
// ==/UserScript==
@matematikaadit
matematikaadit / gfm.rb
Created December 3, 2011 04:26 — forked from mojombo/gfm.rb
require 'digest/md5'
def gfm(text)
# Extract pre blocks
extractions = {}
text.gsub!(%r{<pre>.*?</pre>}m) do |match|
md5 = Digest::MD5.hexdigest(match)
extractions[md5] = match
"{gfm-extraction-#{md5}}"
end

How to Use

cek_ekstensi.rb

$ ./cek_ekstensi.rb hello.rb.doc mini.docx max.dot hello.rb
file: hello.rb.doc adalah file Ms. Word
file: mini.docx adalah file Ms. Word
class LC
def initialize
@res = {1=>1,2=>3,3=>6,4=>6,5=>7,6=>9,7=>13,8=>18,9=>24}
@co = {1=>1,2=>2,3=>3,4=>0,5=>1,6=>2,7=> 4,8=> 5,9=> 6}
end
def lc(n)
@res[n] ||= co(n) + lc(n-1)
end
@matematikaadit
matematikaadit / c++_reintroduction.md
Created February 11, 2012 09:29
C++ Reintroduction

C++ Reintroduction

Saat pertama kali belajar C++, mungkin sebagian dari kita menulis kode seperti ini:

#include <stdio.h>
void main()
{
 printf(“Selamat Datang di Kelas Bahasa Pemrograman Terstruktur!\n”);
@matematikaadit
matematikaadit / skripsi_untuk_blog.md
Created March 3, 2012 00:28
Artikel: Skripsi untuk Blog

Blog untuk Skripsi

Teman-teman yang sekarang jadi mahasiswa tingkat akhir, pasti pernah mengalami stres karena skripsi. Kalau tidak, beruntunglah kalian. Tapi kalau iya, tips berikut ini mungkin akan manjur untuk mengobati stres dan beberapa masalah lain yang muncul akibat proses pembuatan skripsi teman-teman. Bukan hal yang baru tentunya, tapi ide ini cukup menarik dan menyenangkan untuk dicoba.

Dan jangan salah, untuk mereka yang masih belum jadi mahasiswa tingkat akhir, jangan pindah channel dulu. Gak ada salahnya mempersiapkan segala sesuatu dari awal. Toh nanti hal yang sama juga akan kalian hadapi.

@matematikaadit
matematikaadit / dabblet.css
Created April 20, 2012 19:51
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
<!doctype html>
<html>
<head>
<title>Trying</title>
</head>
<body>
Hello World!
</body>
</html>
@matematikaadit
matematikaadit / README.md
Created June 30, 2012 10:18
Daily Programmer Reddit Challenge #70 [Easy]

Reddit Daily Programmer Challenge #70

  • Date: 6/29/2012
  • Level: Easy

Write a program that takes a filename and a parameter n and prints the n most common words in the file, and the count of their occurrences, in descending order.


Request: Please take your time in browsing [/r/dailyprogrammer_ideas][1] and helping in the correcting and giving suggestions to the problems given by other users. It will really help us in giving quality challenges!

@matematikaadit
matematikaadit / default_link.reg
Created September 23, 2012 11:59
Restore Default Link (shortcut)