Skip to content

Instantly share code, notes, and snippets.

View LionRoar's full-sized avatar
🍎

Ferris Ateniese LionRoar

🍎
View GitHub Profile
@LionRoar
LionRoar / load-more-posts.js
Created May 25, 2020 01:45
Wordpress Ajax Load more all
@LionRoar
LionRoar / load-more-posts.js
Created May 25, 2020 01:43
Wordpress Ajax load posts js file
@LionRoar
LionRoar / factorial.js
Created February 2, 2018 20:17
NoRepeatsPlease Inclusion_Exclusiond
//factorial
function f(number){
let $ = 1 , _ = 1;
while($<=number){
_*=$;
$++;
}
return _;
}
@LionRoar
LionRoar / Basic.js
Created February 2, 2018 20:12
NoRepeatsPlease freecodecam solutions
function permAlone(str) {
// Create a regex to match repeated consecutive characters.
var regex = /(.)\1+/g;
// Split the string into an array of characters.
var arr = str.split('');
var permutations = [];
var tmp;
@LionRoar
LionRoar / Advanced.js
Created February 2, 2018 20:12
NoRepeatsPlease freecodecam solutions
function permAlone(str) {
if(str=='') return 1
const bag=new Map()
for(const c of str){
bag.set(c,(bag.get(c)||0)+1)
}
const essence=[][i]; bits+=v
pFact*= fact(i+1)**v * fact(v)
bExp-=bMask; bMask<<=v+1
}
@LionRoar
LionRoar / backtrack.js
Created February 2, 2018 20:10
NoRepeatsPlease
/*
Backtaking - BruteForce aproache
*/
function permAlone(str) {
var perms = [];
var arr = str.split('');
function nonRepeated(){
@LionRoar
LionRoar / Inclusion_Exclusiond.js
Last active February 2, 2018 20:12
NoRepeatsPlease
'use strict';
//factorial
function f(number){
let $ = 1 , _ = 1;
while($<=number){
_*=$;
$++;
}
return _;
@LionRoar
LionRoar / GaussianBlur.cs
Created November 19, 2017 22:33
GaussianBlur
private Bitmap FastGaussianBlur(BitmapW src, int Raduis) {
var bxs = boxesForGaussian(Raduis, 3);
BitmapW img = FastBoxBlur(src, bxs[0]);
BitmapW img_2 = FastBoxBlur(img, bxs[1]);
BitmapW img_3 = FastBoxBlur(img_2, bxs[2]);
return img_3;
}
@LionRoar
LionRoar / gaussBoxes.cs
Last active November 19, 2017 22:28
boxesForGaussianBlur
private int[] boxesForGaussian(double sigma, int n) {
double wIdeal = Math.Sqrt((12 * sigma * sigma / n) + 1);
double wl = Math.Floor(wIdeal);
if (wl % 2 == 0) wl--;
double wu = wl + 2;
double mIdeal = (12 * sigma * sigma– n * wl * wl– 4 * n * wl– 3 * n) / (-4 * wl– 4);
double m = Math.Round(mIdeal);
@LionRoar
LionRoar / fastBoxBlur.cs
Created November 19, 2017 21:06
FastBoxBlur
private Bitmap FastBoxBlur(Bitmap img, int radius) {
int kSize = radius;
if (kSize % 2 == 0) kSize++;
Bitmap Hblur = img.Clone();
float Avg = (float) 1 / kSize;
for (int j = 0; j < img.Height(); j++) {