Skip to content

Instantly share code, notes, and snippets.

@xerosanyam
xerosanyam / find-culprit.js
Created September 14, 2022 10:39
fixed not working? try this snippet
const selector = '.the-fixed-child';
function findCulprits(elem) {
if (!elem) {
throw new Error(
'Could not find element with that selector'
);
}
let parent = elem.parentElement;
while (parent) {
const {
@xerosanyam
xerosanyam / Why not ORM
Created June 8, 2022 17:16
why one should choose any ORM with caution
https://news.ycombinator.com/item?id=19853066
https://www.cs.mcgill.ca/~mxia3/2016/11/18/Statically-typed-PostgreSQL-queries-and-typescript-schemats/
@xerosanyam
xerosanyam / check css.js
Created May 5, 2020 08:59
add this to bookmarklet & see the magic, forked
javascript: (function() {
let domStyle = document.getElementById('domStylee');
if (domStyle) {
document.body.removeChild(domStyle);
return;
}
domStyle = document.createElement("style");
domStyle.setAttribute('id', 'domStylee');
domStyle.append(
['* { color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }'],
@xerosanyam
xerosanyam / check css
Created May 5, 2020 08:59
add this to bookmarklet & see the magic, forked
javascript: (function() {
let domStyle = document.getElementById('domStylee');
if (domStyle) {
document.body.removeChild(domStyle);
return;
}
domStyle = document.createElement("style");
domStyle.setAttribute('id', 'domStylee');
domStyle.append(
['* { color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }'],
@xerosanyam
xerosanyam / check css
Created May 5, 2020 08:59
add this to bookmarklet & see the magic, forked
javascript: (function() {
let domStyle = document.getElementById('domStylee');
if (domStyle) {
document.body.removeChild(domStyle);
return;
}
domStyle = document.createElement("style");
domStyle.setAttribute('id', 'domStylee');
domStyle.append(
['* { color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }'],
@xerosanyam
xerosanyam / custom_game_engines_small_study.md
Created April 25, 2020 13:33 — forked from raysan5/custom_game_engines_small_study.md
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) becaus

@xerosanyam
xerosanyam / Statistics.js
Created July 22, 2019 12:45 — forked from Sirfrummel/Statistics.js
Loading Segment.io analytics.js open source version async
// Create a dummy analytics object until real loaded
window.analytics || (window.analytics = []);
window.analytics.methods = ['identify', 'track', 'trackLink', 'trackForm', 'trackClick', 'trackSubmit', 'page', 'pageview', 'ab', 'alias', 'ready', 'group', 'on', 'once', 'off'];
window.analytics.factory = function(method) {
return function() {
var args = Array.prototype.slice.call(arguments);
args.unshift(method);
window.analytics.push(args);
return window.analytics;
};
@xerosanyam
xerosanyam / write.js
Created August 18, 2018 04:56
write to file in node
var fs = require('fs');
fs.writeFile("list.js", JSON.stringify(list), function(err) {
if(err) {
return console.log(err);
}
console.log("The file was saved!");
});
const TEMP = require('./temp.js')
@xerosanyam
xerosanyam / 1.md
Created June 16, 2018 11:19
Enable https on wordpress blog using bitnami stack with ssl
  1. try to access https://blog.spext.co

  2. if doesn't work, run letsc encrypt script given by bitnami

  3. try to access the https link now

  4. force nginx to route to https