Skip to content

Instantly share code, notes, and snippets.

View par6n's full-sized avatar

Ehsaan par6n

  • The Netherlands
View GitHub Profile
#!/usr/bin/env python
import sys
from urlparse import urlparse
while sys.stdin:
try:
strLine = sys.stdin.readline().strip() ## It is very important to use strip!
uriComponents = urlparse( strLine )
if uriComponents.query == "token=correct":
print uriComponents.path
else:

Chabok job offer exercise

This is an example which uses Node.js as the runtime environment and ClickHouse, which is a column-oriented database management system.

Installation

  1. Create a ClickHouse cluster.
  2. Setup the connection by setting following environment variables: DB_HOST, DB_USER, DB_PASS (you can study the fallback values here.)
  3. Install the script dependencies:
$ npm install
2,3,4,5
1,2,3,4
100,200,300,500,2
10
import fastify from 'fastify';
import { ServerResponse } from 'http';
const S = require('sanctuary');
const healthCheckRoutes = (fastify: fastify.FastifyInstance) => {
fastify.get(
'/ping',
{
schema: {
response: {
@par6n
par6n / spotify-search.py
Created August 12, 2021 21:44
Can be used in Raycast
#!/usr/bin/env python3
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Spotify Search
# @raycast.mode compact
# Optional parameters:
# @raycast.icon 🤖
# @raycast.argument1 { "type": "text", "placeholder": "Query" }