Skip to content

Instantly share code, notes, and snippets.

View marlonpd's full-sized avatar

Marlon Dizon marlonpd

View GitHub Profile
@marlonpd
marlonpd / linux
Last active March 6, 2021 09:01
error: You might want to run 'apt-get -f install' to correct these. The following packages have unmet dependencies: https://askubuntu.com/questions/914428/unmet-dependencies-when-trying-to-install-r-base
sudo apt-get autoremove
sudo apt --fix-broken install
sudo apt-get update
sudo apt-get upgrade
@marlonpd
marlonpd / test
Created November 14, 2017 09:14
test
test
@marlonpd
marlonpd / test
Created November 14, 2017 09:14
test
test
@marlonpd
marlonpd / ins
Created July 14, 2017 06:08
Auto start node.js server on startup
Install :npm install -g pm2
Start the ap: pm2 start app.js -i 3
Start the pm2 processes on start up : pm2 startup
@marlonpd
marlonpd / vue.js
Created March 10, 2017 08:04
Calling main vue instance method from vue component
this.$parent.mainInstanceMethod();
@marlonpd
marlonpd / initializing git in server
Created February 25, 2017 03:56
initializing git in server
Go into the folder.. If the folder is empty, then:
git clone git@github.com:whatever . else
1. git init
2. git remote add origin PATH/TO/REPO
3. git fetch
4. git checkout -t origin/master
@marlonpd
marlonpd / VBoxGuestAdditions-install
Last active January 22, 2017 09:58
Installing VBoxGuestAdditions in VirtualBox Ubuntu
Try:
Reminder:
Virtualbox and VBGuestAdditions should have same version
vagrant plugin install vagrant-vbguest
vagrant up
If won't work, here are the manual steps to install VirtualBox Guest Additions kernel modules inside the VM:
Download the ISO file, e.g.
@marlonpd
marlonpd / inst
Last active September 6, 2016 08:20
Fixing gulp-notify: [Error in notifier] Error in plugin 'gulp-notify' Message: Command failed: notify-send "Laravel Elixir" "Sass Compiled!" --icon "/vagrant/taskmanagerv1/node_modules/laravel-elixir/icons/laravel.png" /usr/bin/env: ruby: No such file or directory Command failed: notify-send "Laravel Elixir" "Sass Compiled!" --icon
1. Install gulp-notify
npm install --save-dev gulp-notify --no-bin-links
2. gulpfile
elixir(function(mix) {
mix
.sass('app.scss')
.browserify('app.js')
.version(['public/css/app.css' , 'public/js/app.js']);
@marlonpd
marlonpd / 0_reuse_code.js
Created December 29, 2015 05:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@marlonpd
marlonpd / gist:c7be6df0d97ed72afb08
Last active November 14, 2017 09:11
Weather forecast using yahoo api
import urllib, json
def Forecast(location):
baseurl = "https://query.yahooapis.com/v1/public/yql?"
yql_query = "select * from weather.forecast where woeid in (select woeid from geo.places(1) where text='"+location+"')"
yql_url = baseurl + urllib.urlencode({'q':yql_query}) + "&format=json"
result = urllib.urlopen(yql_url).read()
data = json.loads(result.decode())
for it in data['query']['results']['channel']['item']['forecast']: