Skip to content

Instantly share code, notes, and snippets.

Avatar
🛠️
creatin' some stuff

Tomasz Ducin ducin

🛠️
creatin' some stuff
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.

View scope-and-closure.md

The scope of a variable is the region of the program in which you can directly access the variable:

if (true) {
  let x = 123;
}

Here, the scope of x is the then-block of this if-then-else statement.

@rosario
rosario / composing-software.md
Created Jan 17, 2018 — forked from Geoff-Ford/composing-software.md
Eric Elliott's Composing Software Series
@ducin
ducin / reveal.js
Created Sep 19, 2016
REVEAL.JS bonus
View reveal.js
Reveal.configure({
keyboard: {
40: 'next',
38: 'prev'
}
});
@btroncone
btroncone / rxjs_operators_by_example.md
Last active Jan 14, 2021
RxJS 5 Operators By Example
View rxjs_operators_by_example.md
@uranusjr
uranusjr / install_ensurepip.py
Created Aug 22, 2014
Script to install ensurepip to Python. “Fix” the Ubuntu 14.04 / Debian Sid bug. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=732703
View install_ensurepip.py
import os
import sys
import io
import tarfile
import urllib.request
ARCHIVE_URL = 'http://d.pr/f/YqS5+'
@ducin
ducin / console-load-js-script.js
Last active Nov 6, 2020
load js script from blank page browser (execute following code in the browser console)
View console-load-js-script.js
(function(root){
root.getScript = function(url) {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = url;
document.head.appendChild(script);
}
}(window));
getScript('http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.js');
@freeeve
freeeve / neoexample.sh
Created Nov 13, 2012
cypher shell script
View neoexample.sh
Wess-MacBook-Pro:bin wfreeman$ cat test.cypher
create (m {name:"m"});
create (n {name:"n"});
Wess-MacBook-Pro:bin wfreeman$ ./neo4j-shell -c < test.cypher
Welcome to the Neo4j Shell! Enter 'help' for a list of commands
NOTE: Remote Neo4j graph database service 'shell' at port 1337
neo4j-sh (?)$ create (m {name:"m"});
+-------------------+
@jonnyreeves
jonnyreeves / testrunner.html
Created Jun 2, 2012
Unit Testing Promises with Sinon.js
View testrunner.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css" type="text/css" media="screen" />
<!-- when.js Promises implementation -->
<script src="https://raw.github.com/cujojs/when/master/when.js"></script>
<!-- Unit testing and mocking framework -->
<script type="text/javascript" src="http://code.jquery.com/qunit/git/qunit.js"></script>
@ryanflorence
ryanflorence / universal-module.js
Created Sep 6, 2011
Universal JavaScript Module, supports AMD (RequireJS), Node.js, and the browser.
View universal-module.js
(function (name, definition){
if (typeof define === 'function'){ // AMD
define(definition);
} else if (typeof module !== 'undefined' && module.exports) { // Node.js
module.exports = definition();
} else { // Browser
var theModule = definition(), global = this, old = global[name];
theModule.noConflict = function () {
global[name] = old;
return theModule;
You can’t perform that action at this time.