Skip to content

Instantly share code, notes, and snippets.

View par6n's full-sized avatar

Ehsaan par6n

  • The Netherlands
View GitHub Profile
@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" }
import fastify from 'fastify';
import { ServerResponse } from 'http';
const S = require('sanctuary');
const healthCheckRoutes = (fastify: fastify.FastifyInstance) => {
fastify.get(
'/ping',
{
schema: {
response: {
2,3,4,5
1,2,3,4
100,200,300,500,2
10

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
#!/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:
package main
import (
"golang.org/x/tour/wc"
"strings"
)
func WordCount(s string) map[string]int {
fields := strings.Fields( s )
output := map[string]int{}

Keybase proof

I hereby claim:

  • I am blacksuited on github.
  • I am ehsaan_me (https://keybase.io/ehsaan_me) on keybase.
  • I have a public key ASAvkWorqhcbwzf6gYedoAxccOazv5xy_Yc9-_MMo0YXlgo

To claim this, I am signing this object:

@par6n
par6n / gulpfile.js
Created August 3, 2015 13:16
Git handler through Gulp, read hive.ir or contact me for more details.
// Example for handling git through gulp. Useful receipt for sometimes ;)
// hive.ir - made by Ehsaan <iehsan.ir@gmail.com>
// gulpfile.js
var gulp = require( 'gulp' );
var git = require( 'gulp-git' );
var minifyCss = require( 'gulp-minify-css' );
var uglify = require( 'gulp-uglify' );
var concat = require( 'gulp-concat' );
var fs = require( 'fs' );
@par6n
par6n / msub.sh
Created May 5, 2017 07:58
Subtitles merge
#!/bin/bash
mkdir -p Output
for f in *.mkv
do
filename="${f%.*}"
echo "Proccessing ${filename}.mkv"
if [ ! -f "${filename}.srt" ]; then
@par6n
par6n / index.js
Created January 13, 2017 05:49
@Link4FileBot
const Telegraf = require( 'telegraf' ),
request = require( 'request' ),
Token = 'TOKEN HERE',
currentUsers = {},
messages = {},
Bot = new Telegraf( Token );
Bot.command( 'start', ( ctx ) => {
ctx.replyWithHTML( `<b>Send/Forward me your files to get the direct link for it.</b>
Powered by @pwrtelegram` );