Skip to content

Instantly share code, notes, and snippets.

View qti3e's full-sized avatar
😃

Parsa qti3e

😃
View GitHub Profile
@qti3e
qti3e / README.md
Last active April 13, 2024 15:50
List of file signatures and mime types based on file extensions
|/|
0> vim
2> cd client && yarn start
3> cd server && yarn start
0
@qti3e
qti3e / backend.min.js
Created April 11, 2017 09:53
js_composer backend.min.js debugged version
function setCookie(e,t,i){var n=new Date;n.setDate(n.getDate()+i);var a=encodeURIComponent(t)+(null===i?"":"; expires="+n.toUTCString());document.cookie=e+"="+a}function getCookie(e){var t,i,n,a=document.cookie.split(";");for(t=0;t<a.length;t++)if(i=a[t].substr(0,a[t].indexOf("=")),n=a[t].substr(a[t].indexOf("=")+1),i=i.replace(/^\s+|\s+$/g,""),i==e)return decodeURIComponent(n)}function vc_toTitleCase(e){return e.replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})}function vc_convert_column_size(e){var t="vc_col-sm-",i=e?e.split("/"):[1,1],n=_.range(1,13),a=_.isUndefined(i[0])||0>_.indexOf(n,parseInt(i[0],10))?!1:parseInt(i[0],10),s=_.isUndefined(i[1])||0>_.indexOf(n,parseInt(i[1],10))?!1:parseInt(i[1],10);return!1!==a&&!1!==s?t+12*a/s:t+"12"}function vc_convert_column_span_size(e){return e=e.replace(/^vc_/,""),"span12"===e?"1/1":"span11"===e?"11/12":"span10"===e?"5/6":"span9"===e?"3/4":"span8"===e?"2/3":"span7"===e?"7/12":"span6"===e?"1/2":"span5"===e?"5/12":"span4"===e?
@qti3e
qti3e / init.lua
Last active August 27, 2023 18:35
My neovim configuration
local o = vim.opt
local map = vim.keymap.set
local api = vim.api
local nvim_create_autocmd = api.nvim_create_autocmd
local nvim_create_augroup = api.nvim_create_augroup
-- =============================================================================
-- Global Options
-- =============================================================================
@qti3e
qti3e / chan_demo.ts
Created May 20, 2021 17:49
Go concurrency in JavaScript
import { Go, Chan, Lock } from "./go";
const chan = Chan<number>();
const sumPromise = Go(async ($: WaitFn) => {
let sum = 0;
for await (const msg of chan.receive()) {
console.log('Received', msg);
sum += msg;
}
async function bottom(props, resolve, parentDom) {
const btn = document.createElement("bottom");
parentDom.appendChild(btn);
btn.onclick = (e) => {
props.onClick(e, resolve);
}
return btn;
}
function html(elementName) {
@qti3e
qti3e / main.c
Last active June 12, 2020 11:07
#include <stdlib.h> // for NULL
#include <sys/mman.h> // for mmap
#include <stdio.h>
#include <string.h>
#include <stdint.h>
unsigned char data[] = {
// "Hello\n"
0x48, 0x65, 0x6c, 0x6c, 0x6f, 0xA
};
@qti3e
qti3e / bernoulli.js
Created May 22, 2019 12:26
Generate first n Bernoulli numbers
function b(max) {
const B = Array(max + 1).fill(0);
B[0] = 1;
B[1] = 1/2;
for (let n = 2; n <= max; n += 2) {
let sum = 0;
let c = 1;
for (let j = 0, j2 = n; j <= n / 2; j += 2, j2 -= 2) {
This file has been truncated, but you can view the full file.
[
{
"names": [
"تورهال"
],
"country": "TR",
"lng": 36.09,
"lat": 40.39
},
{
/**
* ____ _ _ _____
* /___ \ |_(_)___ / ___
* // / / __| | |_ \ / _ \
* / \_/ /| |_| |___) | __/
* \___,_\ \__|_|____/ \___|
*/
import { Request, Response } from "express";