Functors are fancy terms in functional programming field. People from FP (like Haskell) background talks a lot about Functors in their day to day activities, however we as JavaScript developers, using Functors internally in all our application code base! Can't believe? Yes, we are using them without realizing! In this talk, we are going to create our own Functors in JavaScript and understand how real world use cases are solved by using Functors in JavaScript space.
Hello all, I'm in the process of learning Postgres and I find it very hard to find a resource where postgres is explained in terms of developer. Since I'm in the process of reading and applying it in my side project; I treat this gist as my knowledge sharing place on Postgres and its features. Each sub-heading tries to explain the concepts of Postgres with simple example. I may be wrong at times here, if so please free to comment.
All the codes are written and run on psql
I would be adding many stuffs as I learn them. There is no particular order in which I add the contents.
I'm using the following postgres version:
SELECT version();
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nested = [ | |
{ | |
"id": 484856, | |
"subject": { | |
"id": 100183, | |
"name": "Feather", | |
"type": "Post" | |
}, | |
"url": "https://www.producthunt.com/posts/feather-5#comment-484856", | |
"created_at": "2017-06-18T16:49:28.842-07:00", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getCombinations(totalChars) { | |
var result = [] | |
var fn = function(prefix, chars) { | |
for(let i=0;i<chars.length;i++) { | |
result.push(prefix + chars[i]) | |
fn(prefix + chars[i],chars.slice(i+1)) | |
} | |
} | |
fn('',totalChars); | |
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Helper class to generate html and | |
'handle file writing | |
Class HtmlReportGenerator | |
Private fileHandle | |
Private objFSO | |
Private objFile | |
Private Sub Class_Initialize() | |
set objFSO = CreateObject("Scripting.FileSystemObject") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import UIKit | |
func add(a: Int)(b: Int) -> Int { | |
return a + b | |
} | |
func div(a: Int)(b: Int) -> Int { | |
return a % b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import Foundation | |
func tablesOfTwo(x: Int) -> Int { | |
return 2 * x; | |
} | |
func tablesOfThree(x: Int) -> Int { | |
return 3 * x; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import Foundation | |
func tablesOfTwo(x: Int) -> Int { | |
return 2 * x; | |
} | |
func tablesOfThree(x: Int) -> Int { | |
return 3 * x; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import Foundation | |
func getContents(url: String) -> String { | |
var a = url.componentsSeparatedByString(".") | |
var temp = "" | |
for (index, element) in enumerate(a) { | |
temp = "\(temp) \n \(element)"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.TimeUnit; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.NoSuchElementException; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.WebElement; | |
import org.openqa.selenium.firefox.FirefoxDriver; | |
import org.openqa.selenium.support.ui.ExpectedConditions; | |
import org.openqa.selenium.support.ui.FluentWait; | |
import org.openqa.selenium.support.ui.WebDriverWait; |