Skip to content

Instantly share code, notes, and snippets.

🏠
Aló?

Olaf Erlandsen olaferlandsen

🏠
Aló?
View GitHub Profile
@olaferlandsen
olaferlandsen / app.js
Created Jan 14, 2019 — forked from daffl/app.js
Feathers Buzzard improved real-time event filtering dispatchers
View app.js
app.service('messages').dispatch('eventname', (message, hook) => {
// Just dispatch to one user
if(message.isPrivate) {
return app.channel(message.receiver_id);
}
// Returning falsy or nothing will do nothing
});
// Send to a certain room
View Byte Formatting for Google Sheets.md
View gist:6b643b9a3945458b7eba1acdb4284e54
upstream app_server {
ip_hash;
server app_react:3000 max_fails=3 fail_timeout=30s;
}
upstream api_server {
ip_hash;
server api_feathers:3040 max_fails=3 fail_timeout=30s;
}
@olaferlandsen
olaferlandsen / README.md
Last active Nov 25, 2018
Ejercicios base de datos
View README.md
View AzarEntreMaximoMinimo.pse
definir numeroMaximo como entero;
definir numeroMinimo como entero;
definir numeroAlAzarEntre como entero;
numeroMinimo = 1000;
numeroMaximo = 10000;
numeroAlAzarEntre = azar(numeroMaximo-numeroMinimo
)+numeroMinimo;
// simplificado:
@olaferlandsen
olaferlandsen / ObjectSchema.js
Last active May 7, 2018
Create, validate and use "Object Schemas"
View ObjectSchema.js
window.ObjectSchema = function (value, options, throwError) {
var regexpArray = /(array|\[([\]]+)\])/i;
var finalObject = {};
if (typeof options !== "object" || options === null) return false;
if (typeof value !== "object" || value === null) return false;
var defaultOptions = {type : "string", defaultValue : null, nullable : false};
for (var property in value) {
var v = value[property], o = options[property];
if (property in options) {
o = Object.assign(defaultOptions, o || {});
@olaferlandsen
olaferlandsen / gist:dfea2ca397af198f78daaf52eaf21978
Last active Apr 16, 2018
Install node & seting ionic on OSX
View gist:dfea2ca397af198f78daaf52eaf21978
brew install nvm
mkdir ~/.nvm
export NVM_DIR="$HOME/.nvm"
. "/usr/local/opt/nvm/nvm.sh"
nvm install node // download, compile and install the latest version of node
// install cordova, ionic and typescript
npm install -g cordova ionic typescript
// setting ios envivorment
npm install -gf ios-deploy --unsafe-perm=true
@olaferlandsen
olaferlandsen / uninstall-node.sh
Last active Apr 21, 2018
Uninstall completely nodejs from OSX
View uninstall-node.sh
sudo rm -rf /usr/local/lib/node_modules
sudo rm -rf /usr/local/include/node_modules
sudo rm -rf /usr/local/bin/node
sudo rm -rf /usr/local/bin/node-debug
sudo rm -rf /usr/local/bin/node-gyp
sudo rm -rf ~/.npmrc
sudo rm -rf ~/.npm
sudo rm -rf ~/.node-gyp
sudo rm -rf ~/.node_repl_history
sudo rm -rf ~/node_modules
@olaferlandsen
olaferlandsen / app.module.ts
Last active Oct 20, 2017
Directiva para formatear RUT en Ionic2
View app.module.ts
@NgModule({
declarations: [
//...
IonRutDirective
//...
]
})
@olaferlandsen
olaferlandsen / android_instructions.md
Created Mar 15, 2017 — forked from patrickhammond/android_instructions.md
Easily setup an Android development environment on a Mac
View android_instructions.md

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
You can’t perform that action at this time.