// The following code is based off a toggle menu by @Bradcomp
// source: https://gist.github.com/Bradcomp/a9ef2ef322a8e8017443b626208999c1
(function() {
var burger = document.querySelector('.burger');
var menu = document.querySelector('#'+burger.dataset.target);
burger.addEventListener('click', function() {
burger.classList.toggle('is-active');
menu.classList.toggle('is-active');
});
This file contains 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
a = ["B$u$i$ld", "$t$$h$e", "N$e$x$t", "E$$ra", "$$o$f$", "S$$of$t$wa$r$e", "De$$ve$l$op$me$n$t"] | |
for i in a | |
i.to_s | |
i.gsub!('$', '') | |
puts "#{i.upcase}" | |
end | |
some problem if you have new system, try to deploy on github with old ssh, when you add ssh on terminal (command line) Ubuntu.
wicky@code: eval $(ssh-agent)
Agent pid 7xxx
wicky@code: ssh-add ~/.ssh/id_rsa #note id_rsa only name not name.pub but only name
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/home/wicky/.ssh/id_rsa' are too open.
It is required that your private key files are NOT accessible by others.
If your master.key has been compromised, you might want to regenerate it.
No key regeneration feature at the moment. We have to do it manually.
- Copy content of original credentials
rails credentials:show
somewhere temporarily. - Remove
config/master.key
andconfig/credentials.yml.enc
- Run
EDITOR=vim rails credentials:edit
in the terminal: This command will create a newmaster.key
andcredentials.yml.enc
if they do not exist. - Paste the original credentials you copied (step 1) in the new credentials file (and save + quit vim)
- Add and Commit the file
config/credentials.yml.enc
This file contains 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
I got solution from ask ubuntu and youtube chanel here the solution, its about python program: | |
# open terminal and run | |
$ sudo gedit /usr/lib/python3/dist-packages/kazam/pulseaudio/pulseaudio.py | |
# change all with this python code copy all after dash | |
------------------------------------------------------------------------- | |
# -*- coding: utf-8 -*- | |
# | |
# pulseaudio.py | |
# | |
# Copyright 2012 David Klasinc <bigwhale@lubica.net> |
This file contains 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
namespace :db do desc "Backup project database. Options: DIR=backups RAILS_ENV=production MAX=7" | |
task :backup => [:environment] do | |
datestamp = Time.now.strftime("%Y-%m-%d_%H-%M-%S") | |
base_path = Rails.root | |
base_path = File.join(base_path, ENV["DIR"] || "backups") | |
backup_base = File.join(base_path, 'db_backups') | |
backup_folder = File.join(backup_base, datestamp) | |
backup_file = File.join(backup_folder, "#{RAILS_ENV}_dump.sql") | |
FileUtils.mkdir_p(backup_folder) | |
db_config = ActiveRecord::Base.configurations[RAILS_ENV] |
This file contains 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
a = "halooooooooooo" | |
puts "a = halooooooooooo" | |
puts "Objek id dari a: #{a.object_id}" | |
b = a.upcase | |
puts "b = a.upcase" | |
puts b | |
puts "Objek id dari b: #{b.object_id}" |
This file contains 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
a = "234" | |
puts "a = 234" | |
puts "Contoh pakai to_i: #{a.to_i}" | |
b = "1234.5667" | |
puts "b = 1234.5667" | |
puts "Contoh b ada angka di belakangan: #{b.to_i}" | |
c = "abc" |
NewerOlder