Skip to content

Instantly share code, notes, and snippets.

View mamcx's full-sized avatar

Mario Montoya mamcx

View GitHub Profile
@mamcx
mamcx / gist:952601
Created May 3, 2011 00:01
Esquema inicial pasar ciudades de agenda
-- Migracion de Agenda a
-- AdventureWorks R2
USE AdventureWorks
-- Ejecutar solo una vez, para hacer que la BD sea compatible con el
-- COLLATE por defecto de SQL SERVER (Mirar primero SELECT SERVERPROPERTY('collation') )
-- ALTER DATABASE AdventureWorks2008R2 COLLATE MODERN_SPANISH_CI_AS
BEGIN TRANSACTION
@mamcx
mamcx / instawdb.sql
Created May 4, 2011 00:29
Script corregido para reinstalar AdventureWorks
/*============================================================================
File: instawdb.sql
Summary: Creates the AdventureWorks OLTP sample database.
Date: January 06, 2006
Updated: October 17, 2008
SQL Server Version: 10.00.1600.22
------------------------------------------------------------------------------
@mamcx
mamcx / gist:1503278
Created December 20, 2011 21:07
Build schema + Build commands sample
using System;
using System.Text;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using RemObjects.DataAbstract.Server;
using RemObjects.DataAbstract.Schema;
namespace BuildService
{
@mamcx
mamcx / jsonrpclib.py
Created February 22, 2012 20:03
jsonrpclib for dataabstract?
# -*- coding: utf-8 -*-
# a port of xmlrpclib to json....
#
#
# The JSON-RPC client interface is based on the XML-RPC client
#
# Copyright (c) 1999-2002 by Secret Labs AB
# Copyright (c) 1999-2002 by Fredrik Lundh
# Copyright (c) 2006 by Matt Harrison
# Copyright (c) 2008 by Mario Montoya (elmalabarista.com)
@mamcx
mamcx / RODL Heroku.xml
Created May 3, 2012 17:40
Problem with generated RODL
<?xml version="1.0" encoding="utf-8"?>
<Library Name="DataAbstract4" Namespace="RemObjects.DataAbstract.Server" UID="{DC8B7BE2-14AF-402D-B1F8-E1008B6FA4F6}" Version="3.0">
<Services>
<Service Name="DataAbstractService" UID="{709489E3-3AFE-4449-84C3-305C2862B348}" Abstract="1">
<Interfaces>
<Interface Name="Default" UID="{4C2EC238-4FB4-434E-8CFF-ED25EEFF1525}">
<Documentation><![CDATA[ Service WinFormsDAServerService. This service has been automatically generated using the RODL template you can find in the Templates directory.]]></Documentation>
<Operations>
<Operation Name="GetSchema" UID="{684994AA-6829-4497-A054-0ACB6647E24F}">
<Parameters>
@mamcx
mamcx / sample.py
Created September 24, 2012 19:25
My language (work in progres)
# My pet language
int: Int32 #Start at 0
int: Int64 #Start at 0
int: Float #Start at 0.0
num: Num #Start at 0.0, DECIMAL / default number type
name: Str # UTf8
IsTrue: Bool #Start at false
today: Date = 2002-08-10 #Start at 0000-00-00
hour: Hour = 10:00:00 #24 H format #Start at 00:00:00
@mamcx
mamcx / Channels
Created September 17, 2013 14:01
Ideas for my own language
timerChan = chanel(out=chanx:Date)
await def:
time.Sleep(10)
timerChan |> time.Now() # send time on timerChan
#Do something else; when ready, receive.
#Receive will block until timerChan delivers.
#Value sent is other goroutine's completion time.
completedAt <| timerChan
@mamcx
mamcx / Client Database (sqlite).sql
Created February 12, 2014 16:00
Sample design for a sync between iOS sqlite and Postgress
CREATE TABLE Document (
Id integer PRIMARY KEY AUTOINCREMENT,
Guid varchar UNIQUE, /*This is the SERVER ID*/
/* Foreign keys */
FOREIGN KEY (Customer)
REFERENCES Customer(Id) ON DELETE CASCADE,
FOREIGN KEY (Location)
REFERENCES Location(Id) ON DELETE CASCADE
);
@mamcx
mamcx / Program.fsx
Created January 1, 2016 17:06
TablaM Third experimental interpreter
open System.Collections.Generic
let genericTimer anyFunc input =
let stopwatch = System.Diagnostics.Stopwatch()
stopwatch.Start()
let result = anyFunc input //evaluate the function
printfn "elapsed ms is %A" stopwatch.ElapsedMilliseconds
result
let print ast = printfn "%A" ast
@mamcx
mamcx / Interpreter.fs
Created March 9, 2016 21:35
TablaM Experimental interpreter #4
let rec eval (env : Stack) (ast : ExprC) =
let evalEnv = eval env
match ast with
//Basic values
| PassC -> PassC
| NoneC -> NoneC
| BreakC -> BreakC
| IntC _ as v -> v
| BoolC _ as v -> v
| DecC _ as v -> v