Skip to content

Instantly share code, notes, and snippets.

Zoltan Kochan zkochan

View GitHub Profile
View for-snook.md

https://twitter.com/snookca/status/1073299331262889984?s=21

‪“‬In what way is JS any more maintainable than CSS? How does writing CSS in JS make it any more maintainable?”

‪Happy to chat about this. There’s an obvious disclaimer that there’s a cost to css-in-js solutions, but that cost is paid specifically for the benefits it brings; as such it’s useful for some usecases, and not meant as a replacement for all workflows. ‬

‪(These conversations always get heated on twitter, so please believe that I’m here to converse, not to convince. In return, I promise to listen to you too and change my opinions; I’ve had mad respect for you for years and would consider your feedback a gift. Also, some of the stuff I’m writing might seem obvious to you; I’m not trying to tell you if all people of some of the details, but it might be useful to someone else who bumps into this who doesn’t have context)‬

So the big deal about css-in-js (cij) is selectors.

@danielbayley
danielbayley / pnpm.command
Last active May 16, 2020
A shim to seamlessly alias @npm to @pnpm.
View pnpm.command
#! /bin/zsh --no-rcs --err-exit
export PATH=node_modules/.bin:$PATH
alias -g i=install
if (($+commands[pnpm])) then
local p=p
alias pnpm=npm npx=pnpx
# FIXME https://github.com/pnpm/pnpm/issues/1360
npm config get -g global-dir | read
@vmysla
vmysla / iframer-v2.js
Last active Sep 3, 2015
iframer-v2.js
View iframer-v2.js
/*
// ------------ Usage: -------------
// =================================
var container = document.querySelector('body');
var html = "<h1>Timestamp <script>document.write( Date.now() );</script></h1>";
function logFrameEvent(frame, eventName){
console.log(
@vmysla
vmysla / frameless-querySelectorAll.js
Last active Aug 29, 2015
Frameless document.querySelectorAll shim
View frameless-querySelectorAll.js
/// @usage document.querySelectorAll('body');
/// @returns array of matched elements from document and his IFRAMEs (CORS)
document.querySelectorAll = function(){
var result = [].slice.call( HTMLDocument.prototype.querySelectorAll.apply(document, arguments ) );
for(var i=0; i< frames.length; i++){
try {
var doc = frames[i].document;
result = result.concat( [].slice.call( doc.querySelectorAll.apply(doc, arguments) ) );
} catch(e){}
}
@HenrikJoreteg
HenrikJoreteg / README.md
Last active Jun 6, 2018
Minimalist routing in Redux
View README.md

Why would you want to do this? Because you often don't need more. It's nice to not have to think about your "router" as this big special thing.

Instead, with this approch, your app's current pathname is just another piece of state, just like anything else.

This also means that when doing server-side rendering of a redux app, you can just do:

var app = require('your/redux/app')
var React = require('react')
@jansanchez
jansanchez / gist:ce5b0ca1c5e538f4b266
Last active Oct 11, 2019
How to install NVIDIA video drivers in Elementary OS
View gist:ce5b0ca1c5e538f4b266
@staltz
staltz / introrx.md
Last active Jul 3, 2020
The introduction to Reactive Programming you've been missing
View introrx.md
@Fluidbyte
Fluidbyte / SimpleStore.js
Last active Mar 8, 2020
Simple localStorage function with Cookie fallback for older browsers.
View SimpleStore.js
/**
* Simple localStorage with Cookie Fallback
* v.1.0.0
*
* USAGE:
* ----------------------------------------
* Set New / Modify:
* store('my_key', 'some_value');
*
* Retrieve:
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
View gist:2597326

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
You can’t perform that action at this time.