Skip to content

Instantly share code, notes, and snippets.

View tamizhvendan's full-sized avatar
🙋‍♂️
The code is not the goal. Solving the problem is!

Tamizhvendan S tamizhvendan

🙋‍♂️
The code is not the goal. Solving the problem is!
View GitHub Profile
@swanson
swanson / .irbrc
Last active March 3, 2024 17:14
.irbrc color coding Rails console by environment
# Add color coding based on Rails environment for safety
if defined? Rails
banner = if Rails.env.production?
"\e[41;97;1m #{Rails.env} \e[0m "
else
"\e[42;97;1m #{Rails.env} \e[0m "
end
# Build a custom prompt
@johnazariah
johnazariah / free.fs
Created April 3, 2018 22:02
Free Monad with Trampoline Infrastructure and Computation Builder
// F<'a> is any type with member 'map' of type ('a -> 'b) -> F<'a> -> F<'b>
type F<'a> = QIL<'a>
and S<'a> = F<Q<'a>>
and Q<'a> =
private
| Step of Step<'a>
| Bind of IBind<'a>
with
static member lift (k : F<'a>) : Q<'a> = Step (Suspend (fun () -> S<_>.map (Yield >> Step) k))
@battermann
battermann / free.fsx
Last active February 17, 2022 23:26
Free Monad like pattern in F#
#load @"paket-files/fsprojects/Chessie/src/Chessie/ErrorHandling.fs"
type Continuation<'output, 'next> = 'output -> 'next
module TerminalDsl =
open Chessie.ErrorHandling
type Terminal<'next> =
| WriteLine of string * Continuation<unit, 'next>
| ReadLine of unit * Continuation<string, 'next>
@spacedoom
spacedoom / tweetwordextractor.fsx
Last active November 16, 2015 13:13
A simple F# script that extracts words from tweets, given a #tag and a date range. Use this script in order to extract words from tweets, given a #hashtag and a date range. Excellent for creating e.g. word clouds! NB You also have to get a copy of the stopwords.txt file (or create your own). Disclaimer: This is not a finished product. There's ro…
#I @"packages\FSharp.Data.Toolbox.Twitter.0.6\lib\net40"
#I @"packages\FSharp.Data.2.1.1\lib\net40"
#r @".\packages\FSharp.Data.Toolbox.Twitter.0.6\lib\net40\FSharp.Data.Toolbox.Twitter.dll"
#r @".\packages\FSharp.Data.2.1.1\lib\net40\FSharp.Data.dll"
open FSharp.Data.Toolbox.Twitter
// Check out https://apps.twitter.com for more info on getting key & secret!
let key = "" //Insert key here!
@vbfox
vbfox / Dapper.fs
Last active April 21, 2022 02:58
Minimal dapper in F#
module DapperFSharp =
open System.Data.SqlClient
open System.Dynamic
open System.Collections.Generic
open Dapper
let dapperQuery<'Result> (query:string) (connection:SqlConnection) =
connection.Query<'Result>(query)
let dapperParametrizedQuery<'Result> (query:string) (param:obj) (connection:SqlConnection) : 'Result seq =
@tamizhvendan
tamizhvendan / iGoogle-Sample.html
Created September 5, 2012 07:18
Sample iGoogle Page
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Sample iGoogle Page</title>
<style type="text/css">
/* Entire Page has been divided into 3Columns.
Note: iGoogle Page has 3 columns */
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2: