Skip to content

Instantly share code, notes, and snippets.

@larsbs
larsbs / consoleColors.js
Created November 17, 2020 18:32 — forked from abritinthebay/consoleColors.js
The various escape codes you can use to color output to StdOut from Node JS
// Colors reference
// You can use the following as so:
// console.log(colorCode, data);
// console.log(`${colorCode}some colorful text string${resetCode} rest of string in normal color`);
//
// ... and so on.
export const reset = "\x1b[0m"
export const bright = "\x1b[1m"
export const dim = "\x1b[2m"
@larsbs
larsbs / text_colors.xml
Created December 9, 2019 19:21 — forked from jemshit/text_colors.xml
Android Text Colors according to Material Design Pattern
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Dark Text Color for Light Background -->
<color name="textDarkPrimary">#DE000000</color> <!--DE for %87 opacity-->
<color name="textDarkSecondary">#8A000000</color> <!--8A for %54 opacity-->
<color name="textDarkDisabled">#61000000</color> <!--61 for %38 opacity-->
<!-- White Text Color for Dark Background -->
<color name="textLightPrimary">#FFFFFF</color> <!--%100 opacity-->
{
".source.js":
"React: import ReactDOM from react-dom":
prefix: "imrd"
body: "import ReactDOM from 'react-dom';"
"React: import React from react":
prefix: "imr"
body: "import React from 'react';"
@larsbs
larsbs / rxjs_operators_by_example.md
Created January 23, 2017 09:47 — forked from btroncone/rxjs_operators_by_example.md
RxJS 5 Operators By Example
# run this as root (as root user, not with sudo)
while [ 1 ]; do echo | sudo -u nonprivilegeduser nc -l -U /tmp/reload_nginx && /etc/init.d/nginx reload; done
# or as an upstart job
script
echo | nc -l -U /tmp/reload_nginx && /etc/init.d/nginx reload
end script
respawn
# now any process can run this or do the equivalent with sockets to trigger reload
App.Chosen = Ember.Select.extend({
multiple: false,
width: '95%',
disableSearchThreshold: 10,
searchContains: true,
attributeBindings:['multiple', 'width', 'disableSearchThreshold', 'searchContains'],
didInsertElement: function(){
this._super();
App = Ember.Application.create(null);
App.Router.map(function() {
this.resource('content1');
this.resource('content2');
});
App.Content1View = Ember.View.extend({
willAnimateIn: function() {
console.log('willAnimateIn')