Skip to content

Instantly share code, notes, and snippets.

View output.log
$ yarn test
yarn run v1.19.2
$ cross-env NODE_ENV=test CI=true tsdx test packages
PASS packages/component-component/__tests__/component-component.test.tsx
PASS packages/tooltip/__tests__/tooltip.test.tsx
PASS packages/combobox/__tests__/combobox.test.tsx
PASS packages/slider/__tests__/slider.test.tsx
FAIL packages/tabs/__tests__/tabs.test.tsx
● <Tabs /> › focuses the correct tab with keyboard navigation (vertical orientation)
import json
import sqlite3
import zlib
# ~/Library/Safari/CloudTabs.db
# Ref:
db = sqlite3.connect('CloudTabs.db')
tabs = []
peterjmag / icloudtabs2md.js
Created Jul 15, 2019 — forked from mems/icloudtabs2md.js
Generate a markdown links list from iCloud tabs
View icloudtabs2md.js
#!/usr/bin/env node
Generate a markdown links list from iCloud tabs, on macOS
./icloudtabs2md.js >
./icloudtabs2md.js | pbcopy
peterjmag / components.size-chooser-list.js
Last active Jan 12, 2018
Declaratively selecting an option from a list
View components.size-chooser-list.js
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
onSelect(sizeValue) {
View components.test-component-with-init.js
import Ember from 'ember';
export default Ember.Component.extend({
init() {
this.set('items', [
'this is a default value',
'it shouldn’t appear if `items` is passed in from the parent'
View components.test-component.js
import Ember from 'ember';
export default Ember.Component.extend({
someComputedProperty: Ember.computed('item.label', function() {
const item = this.get('item');
Ember.Logger.log('someComputedProperty', item.label);
return `${item.label} ${new Date}`;
peterjmag / Example.jsx
Created Feb 9, 2016
Unused local variable React
View Example.jsx
var React = require('react');
var ReactDOM = require('react-dom');
var SomeComponent = require('./SomeComponent');
<SomeComponent />,
peterjmag /
Last active May 18, 2016
Copying and pasting emoji in Slack

Copy the following snippet:

<meta name="twitter:label1" value="Reading time">
<meta name="twitter:data1" value="3 mins 🕑">
<meta name="twitter:label2" value="Recommends">
<meta name="twitter:data2" value="171 💚">

Paste it into Slack and hit send. (You can use @slackbot as a sort of sandbox if you don’t want to spam your team.)

You should see this:

peterjmag /
Last active Apr 24, 2020 — forked from XueshiQiao/
Generate a MP4 Video for your Git project commits using Gource!
# 1.install gource using HomeBrew
$ brew install gource
# 2.install avconv
git clone git://
cd libav
# it will take 3-5 minutes to complie, be patient.
./configure --disable-yasm
make && make install
peterjmag / TextWithLineBreaks.jsx
Created Aug 30, 2015
TextWithLineBreaks React component
View TextWithLineBreaks.jsx
var _ = require('lodash');
var React = require('react');
module.exports = React.createClass({
displayName: 'TextWithLineBreaks',
render: function () {
var nodes = [];
var fragments = this.props.text.split('\n');
var key = 0;
You can’t perform that action at this time.