Skip to content

Instantly share code, notes, and snippets.

🤓
Dealing with final exams

Parsa Ghadimi qti3e

Block or report user

Report or block qti3e

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@qti3e
qti3e / bernoulli.js
Created May 22, 2019
Generate first n Bernoulli numbers
View bernoulli.js
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) {
View data.json
This file has been truncated, but you can view the full file.
[
{
"names": [
"تورهال"
],
"country": "TR",
"lng": 36.09,
"lat": 40.39
},
View persian.ts
/**
* ____ _ _ _____
* /___ \ |_(_)___ / ___
* // / / __| | |_ \ / _ \
* / \_/ /| |_| |___) | __/
* \___,_\ \__|_|____/ \___|
*/
import { Request, Response } from "express";
@qti3e
qti3e / gist:939157626614b0a1cfe453a4985262cf
Created May 31, 2018 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:939157626614b0a1cfe453a4985262cf

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
View fix_macintosh_portrange.sh
#sudo sysctl -w net.inet.ip.portrange.first=32768
sudo sysctl -w net.inet.ip.portrange.first=12000
sudo sysctl -w net.inet.tcp.msl=1000
sudo sysctl -w kern.maxfiles=1000000 kern.maxfilesperproc=1000000
@qti3e
qti3e / break.js
Created Mar 27, 2018
Why break in a switch statement is important?
View break.js
const o = {
i: 0,
get x() {
return this.i++;
}
};
switch (o.x) {
case 0:
console.log("a");
case 1:
@qti3e
qti3e / lcs.ts
Created Mar 24, 2018
Longest common substring
View lcs.ts
function Int2DArray(a: number, b: number) {
const data = new Int32Array(a * b);
return {
set(i: number, j: number, v: number) {
const index = j * a + i;
data[index] = v;
},
get(i: number, j: number) {
const index = j * a + i;
return data[index];
@qti3e
qti3e / imshow_rgba.patch
Last active Mar 6, 2018
Support RGBA in imshow
View imshow_rgba.patch
commit f37df59507f77cd9e7cad33c27b6c63dd7aae0e5
Author: Parsa Ghadimi <qti3eqti3e@gmail.com>
Date: Tue Mar 6 22:15:36 2018 +0330
[Fix #196] Support RGB in imshow
diff --git a/src/im.ts b/src/im.ts
index adbd34e..26f0c55 100644
--- a/src/im.ts
+++ b/src/im.ts
@qti3e
qti3e / redis.php
Created Mar 2, 2018
Simple Redis Client to understand it's protocol
View redis.php
<?php
/**
* Class myRedisException
*/
class myRedisException extends Exception{
/**
* @var null|string
*/
private $command = '';
/**
@qti3e
qti3e / index.php
Created Mar 2, 2018
A simple template engine in PHP
View index.php
<?php
// 2015/07 :)
/**
* The core class of Template Engine
* Class templateEngine
*/
class templateEngine{
/**
* @type array
*/
You can’t perform that action at this time.