Skip to content

Instantly share code, notes, and snippets.

View ooooak's full-sized avatar
Working from home

Akshay ooooak

Working from home
View GitHub Profile
View abortRequest.tsx
import { unAuthed } from '@utils/http';
import axios, { CancelTokenSource } from 'axios'
import { useState } from 'react';
export function AxiosAbortTest(){
let source: CancelTokenSource | undefined;
async function requestResource(){
if (source){
source.cancel('Operation canceled due to new request.');
ooooak /
Last active June 16, 2021 16:40
(fun downsweep (xPrev Int tree String) Unit
(let [length 10000000)
input (map #(toArray (- % (- 100 50))) '(0 until length))
output (array (- 1 length) :float)
seqtime (standardConfig measure (runningAverage input output))
partime (standardConfig measure (parRunningAverage input output 10000))]
(case xprev
{:node (left right)}
(parallel (downsweep xPrev, left)
ooooak /
Last active February 25, 2020 06:14

Expand lazy

View To study
Learning the "vocabulary" ( partion-all, interpose, nthnext, nthrest, take-nth...)
def rabbits
[{:name "Fluffy" :color :white :size :large}
{:name "Chocolate" :color :brown :size :medium}
View gist:0e244624ace6f80594cf242e03de6cd0
Set-ExecutionPolicy Unrestricted -Scope CurrentUser
ooooak / life_saver.php
Created February 19, 2018 12:20
[laravel] Truncate tables with foreign key
View life_saver.php
\DB::statement('SET FOREIGN_KEY_CHECKS=0');
\DB::statement('SET FOREIGN_KEY_CHECKS=1');
ooooak / read-csv.php
Created February 16, 2018 12:56
read csv in php
View read-csv.php
$path = '/tmp/test.csv';
$header = [];
$items = [];
foreach (array_map('str_getcsv', file($path)) as $key => $row) {
if ($key == 0){
$header = $row;
try {
ooooak / main.cpp
Created January 30, 2018 16:12
keylogger in cpp
View main.cpp
#include <iostream>
#include <Windows.h>
#include <fstream>
#include <string>
#include <ctime>
#include <vector>
#include <iterator>
using namespace std;
View 1vs1 cs go
mp_humanteam any;
mp_warmuptime 333333331;
bot_knives_only 1;
sv_infinite_ammo 1;
mp_autoteambalance 0;
mp_limitteams 999;