I build things with code
I hereby claim:
- I am radiumrasheed on github.
- I am radiumrasheed (https://keybase.io/radiumrasheed) on keybase.
- I have a public key ASComMcs9ZUOEWPOBdqcsg_lyLQvtoL5LhufIinipke1hAo
To claim this, I am signing this object:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injector } from '@angular/core'; | |
export class AppInjector { | |
private static injector: Injector; | |
static setInjector(injector: Injector) { | |
AppInjector.injector = injector; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const solution = (arr) => { | |
if (!arr) return ""; | |
if (arr.length === 0) return ""; | |
const sum = (arr, idx) => { | |
if (idx - 1 < arr.length) { | |
if (arr[idx - 1] === -1) return 0; | |
return arr[idx - 1] + sum(arr, idx * 2) + sum(arr, idx * 2 + 1); | |
} | |
return 0; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "regenerator-runtime/runtime"; | |
import { useState } from "react"; | |
import { useAsyncDebounce } from "react-table"; | |
const ColumnFilter = ({ column }) => { | |
const { filterValue, setFilter } = column; | |
const [value, setValue] = useState(filterValue); | |
const onChange = useAsyncDebounce((value) => { | |
setFilter(value || undefined); | |
}, 300); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.implement('batch', function(callback, loopsPerBatch, delay, bind) { | |
if(!loopsPerBatch) loopsPerBatch = 10; | |
if(!delay) delay = 50; | |
if(callback) { | |
var loops = 0, | |
index = 0, | |
that = this; | |
function doLoops() { | |
loops = 0; | |
for (var length = that.length; (index < length) && loops < loopsPerBatch; index++) { |
OlderNewer