brew install mongodb
Set up launchctl to auto start mongod
$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents
/usr/local/opt/mongodb/
is a symlink to /usr/local/Cellar/mongodb/x.y.z
(e.g., 2.4.9
)
import React, { memo, useReducer, useCallback } from 'react'; | |
import ReactDOM from 'react-dom'; | |
function random(max) { return Math.round(Math.random() * 1000) % max; } | |
const A = ["pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", "quaint", "clean", | |
"elegant", "easy", "angry", "crazy", "helpful", "mushy", "odd", "unsightly", "adorable", "important", "inexpensive", | |
"cheap", "expensive", "fancy"]; | |
const C = ["red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange"]; | |
const N = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", |
#!/usr/bin/ruby | |
# Create display override file to force Mac OS X to use RGB mode for Display | |
# see http://embdev.net/topic/284710 | |
require 'base64' | |
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay` | |
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten | |
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten |
--- | |
- name: Setup SBC | |
hosts: all | |
#become: true | |
#become_user: root | |
gather_facts: false | |
vars: | |
#New user to be created | |
new_user: newuser |
{ | |
"swagger": "2.0", | |
"info": { | |
"version": "v2", | |
"title": "Swagger API" | |
}, | |
"host": "{host}.zendesk.com", | |
"basePath": "/api/v2/", | |
"schemes": [ | |
"http" |
<?php | |
// set the output-file | |
$outputfile = "/var/www/nyt/nyt.jpg"; | |
// set path to todays NYT frontpage | |
$pathToPdf="https://static01.nyt.com/images/".date('Y')."/".date('m')."/".date('d')."/nytfrontpage/scan.pdf"; | |
// check if there is any today | |
$file_headers = @get_headers($pathToPdf); |
var CleanWordHTML = function ( str ) | |
{ | |
str = str.replace(/<o:p>\s*<\/o:p>/g, "") ; | |
str = str.replace(/<o:p>.*?<\/o:p>/g, " ") ; | |
str = str.replace( /\s*mso-[^:]+:[^;"]+;?/gi, "" ) ; | |
str = str.replace( /\s*MARGIN: 0cm 0cm 0pt\s*;/gi, "" ) ; | |
str = str.replace( /\s*MARGIN: 0cm 0cm 0pt\s*"/gi, "\"" ) ; | |
str = str.replace( /\s*TEXT-INDENT: 0cm\s*;/gi, "" ) ; | |
str = str.replace( /\s*TEXT-INDENT: 0cm\s*"/gi, "\"" ) ; | |
str = str.replace( /\s*TEXT-ALIGN: [^\s;]+;?"/gi, "\"" ) ; |
/* | |
Copy this into the console of any web page that is interactive and doesn't | |
do hard reloads. You will hear your DOM changes as different pitches of | |
audio. | |
I have found this interesting for debugging, but also fun to hear web pages | |
render like UIs do in movies. | |
*/ | |
const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
elem.clientLeft
, elem.clientTop
, elem.clientWidth
, elem.clientHeight
elem.getClientRects()
, elem.getBoundingClientRect()