Skip to content

Instantly share code, notes, and snippets.

View salif's full-sized avatar

Salif Mehmed salif

View GitHub Profile
@salif
salif / get_json.js
Created February 22, 2022 23:37
Get JSON with all words from pbd171.db
const words = require('./temp.json')
const fs = require('fs')
for (let i = 0; i < words.length; i+=1904) {
const lcode = 'word_'+words[i].lan_code
for (let j = 0; j < 1904; j++) {
words[j][lcode] = words[i+j].word
}
}

Keybase proof

I hereby claim:

  • I am salif on github.
  • I am salifm_ (https://keybase.io/salifm_) on keybase.
  • I have a public key ASA-FPLiI7Tx156koKlscfJlcMU6md-SI-rznIAgb3b_9Ao

To claim this, I am signing this object:

@salif
salif / README.md
Created June 15, 2021 15:48
Calibre | Replace Liberation font with different font on Arch Linux

Remove ttf-liberation

sudo -i
pacman -Rdd ttf-liberation
rm /usr/share/calibre/fonts/liberation/Liberation*.ttf

Option 1: noto-fonts

@salif
salif / sort.kt
Created May 29, 2021 18:21
Kotlin sort Array<Int>
fun sort(array: Array<Int>): Array<Int> {
when {
array.size == 1 -> {
return array
}
array.size <= 2 -> {
val left = array[0]
val right = array[1]
return if (right < left) {
arrayOf(right, left)
@salif
salif / update-contributors.sh
Last active October 9, 2023 19:03
Update the CONTRIBUTORS file
git shortlog -sn --no-merges | cut -f 2 > CONTRIBUTORS
@salif
salif / sserver.go
Last active September 16, 2020 13:43
Simple HTTP Server (Golang)
package main
import (
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
"os"
)
func main() {
gin.SetMode(gin.ReleaseMode)
ff=$1
llc -filetype=obj $ff.ll
clang $ff.o -o $ff
@salif
salif / ЛИЦЕНЗ.txt
Created July 24, 2020 20:06
EUPL license in BG language, development version
ПУБЛИЧЕН ЛИЦЕНЗ НА ЕВРОПЕЙСКИЯ СЪЮЗ версия 1.2
EUPL © Европейски съюз 2007, 2016
Настоящият публичен лиценз на Европейския съюз (EUPL) се прилага към
произведението (както е определено по-долу), което се предоставя при условията
на този лиценз. Всяко ползване на произведението, различно от това, което е
позволено от настоящия лиценз, e забранено (до степента, в която такова ползване
е предмет на правата на притежателя на авторското право върху произведението).
Произведението се предоставя при условията на настоящия лиценз, когато
@salif
salif / layout.kbd.json
Created December 16, 2019 12:12
Untitled Keyboard Layout
[
[
{
"a": 7,
"fa": [
6
],
"w": 1.25
},
"Tab",
@salif
salif / code_style.md
Created June 5, 2019 20:05 — forked from jesseschalken/code_style.md
Code style

My preferred code style is 2-space K&R. This is intended to provide a justification for this style.

Why K&R?

K&R style has the following properties:

  1. Provides symmetric size (in terms of screen space consumed) between the opening and closing syntax of a clode block.
  2. Forces no empty/meaningless lines, thereby avoiding artificial distance between related things that should be together.
  3. Consumes the minimum vertical space while keeping the opening and closing syntax of the block on separate lines from the content.