Skip to content

Instantly share code, notes, and snippets.

View polesskiy-dev's full-sized avatar

polesskiy-dev polesskiy-dev

View GitHub Profile
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var styleEl = document.getElementById('css-layout-hack');
if (styleEl) {
styleEl.remove();
return;
}
styleEl = document.createElement('style');
styleEl.id = 'css-layout-hack';
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var elements = document.body.getElementsByTagName('*');
var items = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) {
items.push(elements[i]);
}
}
@brauliodiez
brauliodiez / readme.md
Last active September 5, 2024 14:16
lodash/fp set and flow

lodash/fp - set / flow

In this gist we are going to learn about basic goodies that we get from the library lodash/fp (fp stands for functional programming, great for ensuring immutability).We'll learn just by doing (step by step guided sample + codepens).

We'll cover lodash set and flow functions

Steps

  • We'll use codepen as our playground, navigate to this page:
@alexislagante
alexislagante / lcs.js
Created November 2, 2015 15:53
Longest common subsequence in Javascript
function LCS(s1, s2) {
var result = [];
for (var i=0; i<=s1.length; i++) {
result.push([]);
for (var j=0; j<=s2.length; j++) {
var currValue = 0;
if (i==0 || j==0) {
currValue = 0;
} else if (s1.charAt(i-1) == s2.charAt(j-1)) {
currValue = result[i-1][j-1] + 1;