Skip to content

Instantly share code, notes, and snippets.

View ivportilla's full-sized avatar

Ivan Portilla ivportilla

View GitHub Profile
@ivportilla
ivportilla / stylesheet.less
Created November 13, 2016 10:43
Operator Mono + FiraCode ligatures in Atom
atom-text-editor {
font-family: "Operator Mono";
font-size: 14px;
font-weight: 400;
line-height: 1.7;
}
.entity.other.attribute-name,
.entity.name.function {
/* ... */
handleMenuOptions(key) {
switch (key) {
case 'expenses-record': {
Actions.Expenses({ type: ActionConst.REPLACE });
this.props.toggleDrawer();
break;
}
case 'vehicles': {
Actions.Vehicles({ type: ActionConst.REPLACE });
import React from 'react';
import { StyleSheet, View, Text, TextInput } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialIcons';
const styles = StyleSheet.create({
container: {
padding: 10,
},
});
@ivportilla
ivportilla / DEBUG LOG
Last active January 3, 2017 04:19
Feathers auth error
feathers-authentication-local:verify Checking credentials +2ms i@sapcosdfsdf.co abc1234
feathers-authentication:passport:authenticate Authentication strategy 'local' failed +20ms undefined undefined
error: (401) Route: /authentication - Error
info: NotAuthenticated: Error
at NotAuthenticated.ExtendableBuiltin (/home/ivcp/Documents/Sapco/mobi-backend/node_modules/feathers-errors/lib/index.js:21:28)
at NotAuthenticated.FeathersError (/home/ivcp/Documents/Sapco/mobi-backend/node_modules/feathers-errors/lib/index.js:96:116)
at new NotAuthenticated (/home/ivcp/Documents/Sapco/mobi-backend/node_modules/feathers-errors/lib/index.js:149:117)
at /home/ivcp/Documents/Sapco/mobi-backend/node_modules/feathers-authentication/lib/hooks/authenticate.js:79:31
at process._tickCallback (internal/process/next_tick.js:103:7)
POST /authentication
body: {
"access_token": "kjbILH7hl8hpbyPBUP9...",
"strategy": "facebook"
}
RESPONSE:
{
"access_token": "....."
@ivportilla
ivportilla / test.scala
Created February 16, 2017 20:47
Blocking future test
test("blocking in Future") {
var threadsBlock: mutable.Set[String] = scala.collection.mutable.Set()
var threads: mutable.Set[String] = scala.collection.mutable.Set()
def currentThread = Thread.currentThread().getName
/*def nonBlockingFuture = Future{
threads += currentThread
Thread.sleep(1000)
}*/
-module(vars_and_patterns).
-export([xOr1/2, xOr2/2, xOr3/2, maxThree/3, howManyEqual/3]).
xOr1(X, Y) when X and Y ->
false;
xOr1(X, Y) when not(X or Y) ->
false;
xOr1(_, _) -> true.
xOr2(X, Y) when X == Y ->
-module(submission).
-export([bits/1, bitsTail/1, area/1, perimeter/1, enclose/1]).
% Direct recursive definition of bits func.
bits(0) -> 0;
bits(1) -> 1;
bits(N) when (N > 1) -> N rem 2 + bits(N div 2).
% Tail version of the bits func.
bitsTail(N) -> bitsTailIt(N, 0).
const path = require('path');
const webpack = require('webpack');
const apiHost = require('./src/config/deploy.config');
module.exports = {
entry: './src/frontend/app/index.js',
output: {
path: path.resolve(__dirname, './src/frontend/dist'),
filename: 'bundle.js'
},