This file contains hidden or 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 Hashit | |
def initialize(hash) | |
hash.each do |k,v| | |
self.instance_variable_set("@#{k}", v.is_a?(Hash) ? Hashit.new(v) : v) | |
self.class.send(:define_method, k, proc{self.instance_variable_get("@#{k}")}) | |
self.class.send(:define_method, "#{k}=", proc{|v| self.instance_variable_set("@#{k}", v)}) | |
end | |
end | |
end |
This file contains hidden or 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
# /etc/apache2/vhost | |
<VirtualHost *:80> | |
ServerName local.boxgue.com | |
ServerAlias local.boxgue.com | |
DocumentRoot "/Users/cogati/Sites/boxgue" | |
ErrorLog "/private/var/log/apache2/boxgue.com-error_log" | |
CustomLog "/private/var/log/apache2/boxgue.com-access_log" common | |
ServerAdmin [email protected] | |
</VirtualHost> |
This file contains hidden or 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
CREATE USER 'userbaru'@'localhost' IDENTIFIED BY 'password_disini'; | |
GRANT ALL PRIVILEGES ON namadatabase.* To 'userbaru'@'localhost' IDENTIFIED BY 'password_disini'; | |
change password user: | |
use mysql; | |
update user set password=PASSWORD('your_new_password') where User='root'; |
This file contains hidden or 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 | |
for($i = 1; $i <= 100; $i++) { | |
$val = $i; | |
if($i % 3 == 0) $val = "Fizz"; | |
if($i % 5 == 0) $val = "Buzz"; | |
if($i % 3 == 0 && $i % 5 == 0) $val = "FizzBuzz"; | |
echo $val."\n"; | |
} |
NewerOlder