Skip to content

Instantly share code, notes, and snippets.

View muhammadyana's full-sized avatar
🏠
Work From Anywhere

Muhammad Yana Mulyana muhammadyana

🏠
Work From Anywhere
View GitHub Profile
@muhammadyana
muhammadyana / indonesia.geojson
Created July 16, 2019 04:21
Indonesia Geojson Data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@muhammadyana
muhammadyana / indonesia-map-geojson.json
Last active March 29, 2021 00:33
indonesia map geojson
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@muhammadyana
muhammadyana / .bash_profile
Created September 28, 2017 03:05 — forked from dirkraft/.bash_profile
.bash_profile (for Mac)includes sections for Bash, Homebrew, Ruby, Python, AWS
###############################################################################
# Globals-ish
export VISUAL=vim
export EDITOR=vim
export JAVA_HOME=`/usr/libexec/java_home`
###############################################################################
# Bash
@muhammadyana
muhammadyana / Gemfile
Created August 21, 2017 03:01 — forked from cblunt/Gemfile
Configure Carrierwave for Amazon S3 Storage and Heroku
# ...
gem 'carrierwave'
gem 'fog', '~> 1.0.0' # Need to specify version, as carrierwave references older (0.9.0) which doesn't allow configuration of Rackspace UK Auth URL
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/User/Color Highlighter/themes/Monokai-Soft-MD (Colorcoded).tmTheme",
"font_options":
[
"gray_antialias",
"subpixel_antialias"
],
"ignored_packages":
@muhammadyana
muhammadyana / axlsx_style_example.rb
Created August 12, 2017 03:26
Custom Style axlsx style gem
#!/usr/bin/env ruby -w -s
# -*- coding: utf-8 -*-
$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib"
#```ruby
require 'axlsx'
examples = []
examples << :basic
examples << :custom_styles
examples << :wrap_text
#take every sentence
counts = Hash.new(0)
File.foreach("sample.txt") do
|line|
line.scan(/\w+/) do
|word|
word = word.downcase
counts[word] += 1
end
end
@muhammadyana
muhammadyana / url-and-http.rb
Created June 9, 2017 08:56
parsing HTML in Ruby
#require 'socket'
require 'net/http'
require 'open-uri'
require 'nokogiri'
client = TCPSocket.open('indoexchanger.co.id', 'www')
client.send("OPTIONS /~dave/ HTTP/1.0\n\n", 0)
puts client.readlines
client.close
@muhammadyana
muhammadyana / file.rb
Created June 9, 2017 08:55
Read, write update and delete file in Ruby
#thursday-08-2017
#@41studio
#Muhammad Yana Mulyana
#R/W File in ruby
File.open("sample.txt", "r") do |f|
f.each_line do |line|
puts line
end
end
#thursday-08-2017
#@41studio
#Muhammad Yana Mulyana
#regex in ruby
# require 'net/http'
# image = Net::HTTP.get_response(URI.parse("http://www.indoexchanger.co.id/private/rest/indoExchanger/amountBitcoin")).body
#
# puts image