Skip to content

Instantly share code, notes, and snippets.

View antsmartian's full-sized avatar
💭
Hacking...

antsmartian antsmartian

💭
Hacking...
  • India
View GitHub Profile
@antsmartian
antsmartian / FlipkartCodingSession3.java
Created September 12, 2015 12:08
Flipkart Selenium Session 3
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;
package main
import (
"fmt"
"net/http"
"io/ioutil"
"golang.org/x/net/html"
"bytes"
"github.com/PuerkitoBio/goquery"
"net/url"
https://dave.cheney.net/
package main
import (
"time"
"net"
"os"
"strings"
"fmt"
"syscall"
)
package main
import (
"sync"
)
type DB struct {
mu sync.RWMutex
data map[string]string
}

Functors In JavaScript Space.

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.

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",
@antsmartian
antsmartian / cp.js
Last active February 9, 2017 09:22
combinations and permutations
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
@antsmartian
antsmartian / initOrder.php
Created March 21, 2013 13:08
Juspay Init Order Example Call Php.
<?php
#Example integration with iFrame based solution
#Step 1
#Initiate the order with initorder api call
$ch = curl_init('https://api.juspay.in/init_order');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);