Skip to content

Instantly share code, notes, and snippets.

View ukazap's full-sized avatar

Ukaza Perdana ukazap

View GitHub Profile
@ukazap
ukazap / vhosts.bat
Created April 14, 2015 08:18
Windows batch script for creating new virtual host entries on Apache.
@echo off
set texteditor=subl rem Text editor of your choice e.g. Sublime Text (subl)
set hostsfile=C:/Windows/System32/drivers/etc/hosts rem Where Windows' hosts file is located
set vhostsfile=C:/wamp/bin/apache/apache2.4.9/conf/extra/httpd-vhosts.conf rem This one depends on your installation.
set htdocs=C:/wamp/www rem This one depends on your installation.
if ["%1"] == ["edit"] goto:edit
if ["%1"] == ["add"] goto:add
goto:usage
@ukazap
ukazap / elgamal.rb
Created December 16, 2015 23:47
Contoh Mainan Algoritma Elgamal dalam Ruby
require 'prime'
####### PEMBANGKITAN KUNCI OLEH ALICE
# Pilih sembarang bilangan prima p (p dapat di-share di antara anggota kelompok)
p = Prime.take(1000).last #bilangan prima ke-1000
# Pilih dua buah bilangan acak, g dan x, dengan syarat g < p dan 1 <= x <= p – 2
g, x = nil
until g != x
@ukazap
ukazap / jenengi.rb
Last active January 20, 2016 01:25
Ruby script for recursively renaming current directory's files and folders to fix Windows invalid characters: /\?%*|"<>
#!/usr/bin/env ruby
pwd = Dir.pwd
puts pwd + "\n#{"="*pwd.length}"
entries = Dir.glob(pwd+"/**/*", File::FNM_DOTMATCH)
renamed = 0
entries.reverse.each do |file|
unless File.basename(file) =~ /^(\.\.|\.)\z/
@ukazap
ukazap / google.xml
Last active September 12, 2016 23:58
Google Search plugin for web browsers with suggestions
<OpenSearchDescription>
<ShortName>Google</ShortName>
<Description>Google</Description>
<Tags>google</Tags>
<Image height="16" width="16" type="image/vnd.microsoft.icon">http://www.google.com/favicon.ico</Image>
<Url type="text/html" template="http://www.google.com/search?q={searchTerms}"/>
<Url type="application/x-suggestions+json" method="GET" template="https://www.google.com/complete/search?client=firefox&amp;q={searchTerms}"/>
</OpenSearchDescription>

Keybase proof

I hereby claim:

  • I am ukazap on github.
  • I am ukazap (https://keybase.io/ukazap) on keybase.
  • I have a public key ASDaB0Vp2caiWvh3Ku-tTGSQOIZLZxQAj-s5izDOBy0rpwo

To claim this, I am signing this object:

@ukazap
ukazap / flat_list_to_tree.js
Last active November 10, 2017 05:26
Write a function that take source and convert to target.
let source = [
{
name: "Account A"
},
{
name: "Account B"
},
{
name: "Account C"
},
@ukazap
ukazap / introrx.md
Created January 19, 2018 04:21 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@ukazap
ukazap / multiple_ssh_setting.md
Created April 4, 2018 16:14 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@ukazap
ukazap / svgicon.css
Created June 5, 2018 03:11 — forked from MoOx/svgicon.css
Svg icons with React.js with webpack loader (svg: raw-loader)
.SVGIcon {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
/* fix webkit/blink poor rendering issues */
transform: translate3d(0,0,0);
/* it's better defined directly because of the cascade shit
width: inherit;
height: inherit;
@ukazap
ukazap / web-servers.md
Created June 24, 2018 00:35 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000