Skip to content

Instantly share code, notes, and snippets.

@furquanuddin94
furquanuddin94 / hammerspoon-init.lua
Last active October 7, 2024 13:22
Lua script for hammerspoon for easy switching between apps.
— Define your hyper key
local hyper = {"ctrl", "alt", "cmd", "shift"}
— Define a table of applications with their bundle identifiers and hotkeys
local apps = {
{key = "C", bundleID = "com.todesktop.230313mzl4w4u92"}, — Cursor App
{key = "B", bundleID = "com.google.Chrome"}, — Google Chrome
{key = "P", bundleID = "com.postmanlabs.mac"}, — Postman
{key = "I", bundleID = "com.jetbrains.intellij"}, — IntelliJ
{key = "T", bundleID = "com.googlecode.iterm2"}, — iTerm
supplier_name: Vendor2
# All vendor endpoints that will be generated in the network client.
endpoints:
- Auth
- Search
# Endpoints that will be in the service, called sequentially in the given order
mapping:
Search:
supplier_name: Vendor1
# All vendor endpoints that will be generated in the network client.
endpoints:
- Search
# Endpoints that will be in the service, called sequentially in the given order
mapping:
Search:
- Search
package com.someRandomVendor.search
private[search] class SomeRandomVendorSearchService(
client: SomeRandomVendorClient,
requestMapper: Mapper[SearchRequest, SomeRandomVendorSearchRequest],
responseMapper: Mapper[SomeRandomVendorSearchResponse, SearchResponse]) extends SearchService {
override def search(request: SearchRequest): Future[SearchResponse] = {
for {
//validate request
package $package$.search
private[search] class $Supplier$SearchService(
client: $Supplier$Client,
requestMapper: Mapper[SearchRequest, $Supplier$SearchRequest],
responseMapper: Mapper[$Supplier$SearchResponse, SearchResponse]) extends SearchService {
override def search(request: SearchRequest): Future[SearchResponse] = {
for {
//validate request
@furquanuddin94
furquanuddin94 / portkey
Last active April 26, 2019 10:51
Utility to access server boxes (over SSH) via IP or ELB (specifically for AWS).
#!/bin/bash
#Script to access server boxes
#Put the script in any directory present on system's $PATH. Make the file executable via "chmod +x portkey". Then use "portkey help" for instructions on how to use.
#Prerequirements: Install JQ and Sponge
homeDir=$( echo $HOME )
configFile="${homeDir}/portkey.conf"
paramCount="$#"
if [ "$paramCount" = "0" ] || [ "$1" = "help" ]