Skip to content

Instantly share code, notes, and snippets.

View diegorribeiro's full-sized avatar
🎯
Focusing

Diego Ribeiro diegorribeiro

🎯
Focusing
View GitHub Profile
@diegorribeiro
diegorribeiro / databind_example.ts
Created February 22, 2018 17:10
Ionic v2 - Receive data from promise on controller & bind to view [SOLVED]
//include NgZone in constructor
constructor(public navCtrl: NavController, private zone: NgZone, public platform: Platform) {
}
getData(){
//Your promise here
var label = result.label; //data callback return
var enableDiv = result.enableDiv; //data callback return
@diegorribeiro
diegorribeiro / ionic_generate.txt
Created February 22, 2018 21:17
$ ionic generate
Synopsis
$ ionic generate [<type>] [<name>]
Details
Automatically create components for your Ionic app.
The given name is normalized into an appropriate naming convention. For example, ionic generate page neat creates a page by the name of NeatPage in src/pages/neat/.
Input Description
@diegorribeiro
diegorribeiro / moodlemobile2.css
Last active March 19, 2018 16:46
Change moodlemobileapp.css advanced after choosing site
.bar-header {
background-color: #4F5865;
color: #313848;
}
ion-side-menu li .item {
background-color: #313848;
border-color: #4F5865;
color: #FFF;
}
@diegorribeiro
diegorribeiro / Bower example
Created March 15, 2018 12:41
bower ESUDO Cannot be run with sudo -> add this: --allow-root
Ex:
npm run setup --allow-root
@diegorribeiro
diegorribeiro / permission.sh
Created March 15, 2018 20:17
Ubuntu set permission
chmod -R 777 insight-cordova.json
@diegorribeiro
diegorribeiro / gulpcheck.sh
Created March 19, 2018 14:16
Gulpfile.js Error in Moodlemobile2 Ionic
#in linux you fix this with the command:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
@diegorribeiro
diegorribeiro / process.sh
Created April 6, 2018 16:24
React-native npm start not working ? kill process in port 8081
#Terminating a process on port 8081
#Run the following command on a Mac to find the id for the process that is listening on port 8081:
$ sudo lsof -i :8081
#Then run the following to terminate the process:
$ kill -9 <PID>
@diegorribeiro
diegorribeiro / fix_zsh_history.sh
Created April 23, 2018 17:04
Zsh history error
#!/bin/sh
# Borrowed from http://marcparadise.com/blog/2013/09/21/how-to-fix-a-corrupt-history-file/
# If you ever see a message like this upon starting a new shell
# zsh: corrupt history file /home/marc/.zsh_history
# here is a quick fix
cd ~
mv .zsh_history .zsh_history_bad
strings .zsh_history_bad > .zsh_history
# And reload history
fc -R .zsh_history
@diegorribeiro
diegorribeiro / git_clean_cached.sh
Created April 24, 2018 17:30
Git remove cached itens after update .gitignore file
git rm --cached <file>
#or
git rm --cached . -r && git add . && git commit -m "Message" && git push
@diegorribeiro
diegorribeiro / settings.json
Created April 24, 2018 23:15
VSCode not detect php.validate.executablePath":
//Then put that in your settings.json:
{
"php.validate.executablePath":"D:/xampp/php/php.exe"
}