Skip to content

Instantly share code, notes, and snippets.

View ademar's full-sized avatar
👻
Building stuff

Ademar Gonzalez ademar

👻
Building stuff
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ademar on github.
  • I am ademar (https://keybase.io/ademar) on keybase.
  • I have a public key whose fingerprint is 9321 F370 F2D3 CB59 37FB F881 7E2C DB32 F13C 9E5B

To claim this, I am signing this object:

@ademar
ademar / gist:dcb5cd2fdd832fc34baa
Created October 30, 2014 14:06
Generate GRANT statements for stored procedures (SQL Server 2000)
DECLARE @User varchar(50)
SELECT @User = 'myuser'
SELECT
'GRANT EXEC ON ' + name + ' TO ' + @User
FROM
sysobjects
WHERE
type = 'P'
AND category = 0
@ademar
ademar / sample.php
Created August 21, 2015 13:21
PHP example : Sending email and performing SMTP authentication with Pearl Mail package
<?
# PHP example : Sending email and performing SMTP authentication with Pearl Mail package
include_once("Mail.php");
$recipients = 'mail_to@domain.mail';
$headers["From"] = 'mail_from@domain.mail';
$headers["To"] = 'mail_to@domain.mail';
@ademar
ademar / gist:898038
Created April 1, 2011 12:00
One-Way File Synchronization
// Learn more about F# at http://fsharp.net
open Microsoft.FSharp.Control
open System.Collections.Generic
open System.Threading
open System.IO
type RequestGate(n:int) =
let semaphore = new Semaphore(initialCount=n,maximumCount=n);
member x.AcquireAsync(?timeout) =
async {
@ademar
ademar / gist:911439
Created April 9, 2011 14:39
How to write a financial contract
//Implements the theory from 'How to write a financial contract' by S.L Peyton Jones and J-M Eber
type RandomVariable<'a> = seq<'a>
type Process<'a> = Process of (seq<RandomVariable<'a>>)
let liftP f (Process(p)) = Process(Seq.map (Seq.map f) p)
let liftP2 f (Process(p1)) (Process(p2)) =
Process(Seq.map2 (Seq.map2 f) p1 p2)

Keybase proof

I hereby claim:

  • I am ademar on github.
  • I am ademar (https://keybase.io/ademar) on keybase.
  • I have a public key whose fingerprint is E397 C714 13D6 781E 5E83 629D 1A3B 3917 6D43 2321

To claim this, I am signing this object:

@ademar
ademar / file.fs
Last active June 26, 2016 18:36
Logary plus Logstash
open Logary
open Logary.Configuration
open Logary.Targets
open Hopac
let logstashConf = Logstash.LogstashConf.create("tcp://127.0.0.1:1939")
let pointName = PointName.ofSingle "logstash"
let logary =
#!/usr/bin/env python
# Wikipedia: https://en.wikipedia.org/wiki/Metcalfe%27s_law
import numpy as np
from matplotlib import pyplot as plt
import urllib
def g(u):
return urllib.urlopen(u).readlines()
Verifying that "ademar.id" is my Blockstack ID. https://onename.com/ademar
### Keybase proof
I hereby claim:
* I am ademar on github.
* I am ademar (https://keybase.io/ademar) on keybase.
* I have a public key whose fingerprint is 1EBA 8095 9E88 913B 7D5C ADC3 5882 6291 9525 EFE7
To claim this, I am signing this object: