Skip to content

Instantly share code, notes, and snippets.

View Kaybarax's full-sized avatar
🏗️
Buidling

Kevin Kaybarax

🏗️
Buidling
View GitHub Profile
@Kaybarax
Kaybarax / util.ts
Created June 3, 2021 09:04
kaybarax-public-js-ts-util
/* eslint-disable */
//key
//sd - self described
/**
* @authored by Kaybarax
*/
/**
* sd _ Kaybarax
@Kaybarax
Kaybarax / react-native-based-utils.ts
Created June 3, 2021 08:59
kaybarax-public-react-native-based-utils
/* eslint-disable */
//key
//sd - self described
/**
* @authored by Kaybarax
*/
import RN from "react-native";
import { check, request, RESULTS } from "react-native-permissions";
import { isBooleanTypeAndTrue, isEmptyArray, isEmptyString, isNullUndefined, isObject, stringifyObject } from "./util";
const { createServer } = require('http');
createServer((req, res) => {
res.writeHead(200, {
Connection: 'Transfer-Encoding',
'Content-Type': 'text/html; charset=utf-8',
'Transfer-Encoding': 'chunked'
});
res.write(`
const { createServer } = require('http');
createServer((req, res) => {
res.writeHead(200, {
Connection: 'Transfer-Encoding',
'Content-Type': 'text/html; charset=utf-8',
'Transfer-Encoding': 'chunked'
});
res.write(`
@Kaybarax
Kaybarax / html5-canvas-post-to-facebook-base64.js
Created December 11, 2018 15:39 — forked from a-guerrero/html5-canvas-post-to-facebook-base64.js
Post a BASE64 Encoded PNG Image to facebook
// Post a BASE64 Encoded PNG Image to facebook
function PostImageToFacebook(authToken) {
var canvas = document.getElementById("c");
var imageData = canvas.toDataURL("image/png");
try {
blob = dataURItoBlob(imageData);
} catch (e) {
console.log(e);
}
var fd = new FormData();
@Kaybarax
Kaybarax / glide-carousel-semantic-ui.markdown
Created June 10, 2018 10:46
Glide Carousel & Semantic UI
@Kaybarax
Kaybarax / KMP.js
Created December 7, 2017 13:45 — forked from blasten/KMP.js
String matching based on the KMP algorithm. This how `String.prototype.indexOf` is generally implemented.
// Construct a table with table[i] as the length of the longest prefix of the substring 0..i
function longestPrefix(str) {
// create a table of size equal to the length of `str`
// table[i] will store the prefix of the longest prefix of the substring str[0..i]
var table = new Array(str.length);
var maxPrefix = 0;
// the longest prefix of the substring str[0] has length
table[0] = 0;
@Kaybarax
Kaybarax / BinarySearch.js
Created December 7, 2017 10:30 — forked from cbdavide/BinarySearch.js
Binary search algorithm in javascript
var binarySearch = function(array, value) {
var guess,
min = 0,
max = array.length - 1;
while(min <= max){
guess = Math.floor((min + max) /2);
if(array[guess] === value)
return guess;
else if(array[guess] < value)