Skip to content

Instantly share code, notes, and snippets.

View abdalla's full-sized avatar
🏠
Working from home

Carlos Abdalla abdalla

🏠
Working from home
View GitHub Profile
@abdalla
abdalla / CustomControllerFactory.cs
Created March 5, 2012 22:38
RavenDB Repository
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Msdev.EventSystem.Core.Data.Raven;
using Raven.Client.Document;
namespace Msdev.EventSystem.Ui.Controllers.Factory
{
@abdalla
abdalla / gist:1986624
Created March 6, 2012 14:42
Using AutoMApper
>Basic
Mapper.CreateMap<EventViewModel, Event>();
Event _event = Mapper.Map<EventViewModel, Event>(model);
>Ignoring Some Fields
Mapper.CreateMap<EventViewModel, Event>().ForMember("EventId", r => r.Ignore()).ForMember("CreatedOn", r => r.Ignore()).ForMember("EventStatusId", r => r.Ignore());
_event = Mapper.Map(model, _event);
<Router>
<Route path="/" component={App}>
<IndexRoute component={Lander} />
<Route path="com/:opco/signin" component={SignIn} />
<Route path="com/:opco/search/colors" component={SearchPatternColorView} onEnter={onEnter} function="ViewFabric" />
<Route path="com/:opco/pattern/:patternID" component={MaintainPattern} onEnter={onEnter} function="ViewFabric" />
<Route path="com/:opco/pattern/:patternID/color/:colorID" component={MaintainColor} onEnter={onEnter} function="ViewFabric" />
<Route path="com/:opco" component={sendAdobeAnalyticsPageInformation(RequestLoggedIn, 'com request')} onEnter={onEnter} function="ViewFabric" />
<Route path="com/:opco/admin-dashboard" component={ComAdminDashboard} onEnter={onEnter} function="EditAdminDashboard" />
<Route path="com/:opco/user-dashboard" component={sendAdobeAnalyticsPageInformation(ComUserDashboard, 'view my com')} onEnter={onEnter} function="ViewMyRequestsDashboard" />
@abdalla
abdalla / for_fun
Created March 23, 2017 16:43
for_fun
const exchange = vl => {
const nr_qt = Math.floor(vl/25);
console.log(nr_qt);
let rest = vl - (nr_qt * 25);
const nr_dim = Math.floor(rest/10);
console.log(nr_dim);
rest -= nr_dim * 10;
@abdalla
abdalla / enjoy
Created March 23, 2017 16:56
enjoy
const typesOfCoins = [25, 10, 5, 1];
const exchange = vl => {
let exchanges = [];
typesOfCoins.reduce((cur, next) => {
const val = Math.floor(cur/next);
const rest = cur - (val * next);
exchanges.push(val);
@abdalla
abdalla / Sublime-Settings
Created May 5, 2017 13:24
Abdalla-Sublime-Settings
{
"bold_folder_labels": false,
"caret_extra_bottom": 2,
"caret_extra_top": 2,
"caret_extra_width": 3,
"caret_style": "smooth",
"color_scheme": "Packages/ayu/ayu-mirage.tmTheme",
"font_face": "Courier New",
"font_size": 13,
"highlight_line": true,
@abdalla
abdalla / Dockerfile
Created May 5, 2017 22:28
Tutorial - Dockerfile
FROM fedora
RUN yum update -y
RUN yum install -y nodejs
RUN mkdir -p /src && cd /src
WORKDIR /src
@abdalla
abdalla / Tutorial - docker-compose.yml
Created May 8, 2017 21:53
Tutorial - docker-compose.yml
version: '3'
services:
abdalla:
build: .
container_name: nodjs-test
image: abdalla/nodejs
volumes:
- .:/src
tty: true
@abdalla
abdalla / v8.md
Created July 5, 2017 00:44 — forked from kevincennis/v8.md
V8 Installation and d8 shell usage

Installing V8 on a Mac

Prerequisites

  • Install Xcode (Avaliable on the Mac App Store)
  • Install Xcode Command Line Tools (Preferences > Downloads)
  • Install depot_tools
    • git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
    • sudo nano ~/.bash_profile
    • Add export PATH=/path/to/depot_tools:"$PATH" (it's important that depot_tools comes first here)
@abdalla
abdalla / routes.js
Created January 23, 2019 14:32
MODAFOCA
import React, { Component, PureComponent } from 'react';
import {
createStackNavigator,
createBottomTabNavigator
} from 'react-navigation';
import { Image, View, Text } from 'react-native';
import { Actions, Scene, Router } from 'react-native-router-flux';
import Icon from 'react-native-vector-icons/FontAwesome';
import colors from './src/constants/colors';