Skip to content

Instantly share code, notes, and snippets.

View Cartmanishere's full-sized avatar
💻

Pranav Gajjewar Cartmanishere

💻
View GitHub Profile
(require '[hbs.core :as hbs])
;; render template string
(hbs/render "Hello {{person.name}}!" {:person {:name "John"}})
;; OR
;; render template file with a registry
(def reg (hbs/registry (hbs/classpath-loader "/templates")))
(hbs/render-file reg "mytemplate" {:name "John"})
// Initialize the loader using a prefix
TemplateLoader loader = new HTTPTemplateLoader("https://bucket-name.s3.Region.amazonaws.com/");
Handlebars handlebars = new Handlebars(loader);
Template template = handlebars.compile("index");
Map<String, String> data = new HashMap<>();
data.put("name", "John");
System.out.println(template.apply(data));
TemplateLoader loader = new FileTemplateLoader("/home/templates/");
Handlebars handlebars = new Handlebars(loader);
Template template = handlebars.compile("mytemplate");
Map<String, String> data = new HashMap<>();
data.put("name", "John");
System.out.println(template.apply(data));
// Initialize the handlebars class
Handlebars handlebars = new Handlebars();
// Compile the required template file
Template template = handlebars.compile("mytemplate");
// Data
Map<String, String> data = new HashMap<>();
data.put("name", "John");
@Cartmanishere
Cartmanishere / pydrive-basic.ipynb
Last active December 24, 2020 14:57
Basic operations like Auth, Upload, List, Download, Delete using PyDrive
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Template v0.0.1 | {{data}}
# Prevent Trackers and Malwares
https://raw.githubusercontent.com/DRSDavidSoft/additional-hosts/master/domains/blacklist/adservers-and-trackers.txt
https://gitlab.com/quidsup/notrack-blocklists/raw/master/notrack-malware.txt
https://gitlab.com/quidsup/notrack-blocklists/raw/master/notrack-blocklist.txt
https://raw.githubusercontent.com/notracking/hosts-blocklists/master/hostnames.txt
https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt
https://gitlab.com/my-privacy-dns/matrix/matrix/-/raw/master/source/tracking/domains.list
https://raw.githubusercontent.com/r-a-y/mobile-hosts/master/AdguardApps.txt
https://raw.githubusercontent.com/r-a-y/mobile-hosts/master/AdguardMobileAds.txt
https://raw.githubusercontent.com/FadeMind/hosts.extras/master/StreamingAds/hosts
@Cartmanishere
Cartmanishere / railwire.py
Last active October 16, 2021 05:16
Scrape data usage information from Railwire account using Python
#!/Users/pranav/.pyenv/shims/python
"""
Requirements:
- Python3
PIP Install:
- bs4
- requests
- lxml
What?
@Cartmanishere
Cartmanishere / client.go
Created November 1, 2019 10:58
Golang client for grpc-python-golang example
func main() {
client, err := InitGrpcConnection()
if err != nil {
fmt.Println(err)
os.Exit(0)
}
reader := bufio.NewReader(os.Stdin)
for {
@Cartmanishere
Cartmanishere / client.go
Created November 1, 2019 10:55
Golang client for grpc-python-golang-example
package main
import (
"context"
"google.golang.org/grpc"
"fmt"
"bufio"
"os"
nltk "golang/nltk_service"
)