This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
| // To subscribe to an event, pass this JSON text to the client through the WebSocket: | |
| { | |
| "body": { | |
| "eventName": "NameOfEvent" // Replace with an event name listed below | |
| }, | |
| "header": { | |
| "requestId": "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx", // UUID | |
| "messagePurpose": "subscribe", | |
| "version": 1, // Protocol version (currently 1 as-of 1.0.2) |
| /** | |
| * Using Operator Mono in Atom | |
| * | |
| * 1. Open up Atom Preferences. | |
| * 2. Click the “Open Config Folder” button. | |
| * 3. In the new window’s tree view on the left you should see a file called “styles.less”. Open that up. | |
| * 4. Copy and paste the CSS below into that file. As long as you have Operator Mono SSm installed you should be golden! | |
| * 5. Tweak away. | |
| * | |
| * Theme from the screenshot (http://cdn.typography.com/assets/images/blog/operator_ide2.png): |
2015-01-29 Unofficial Relay FAQ
Compilation of questions and answers about Relay from React.js Conf.
Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.
Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).
| function getHightlightCoords() { | |
| var pageIndex = PDFViewerApplication.pdfViewer.currentPageNumber - 1; | |
| var page = PDFViewerApplication.pdfViewer.getPageView(pageIndex); | |
| var pageRect = page.canvas.getClientRects()[0]; | |
| var selectionRects = window.getSelection().getRangeAt(0).getClientRects(); | |
| var viewport = page.viewport; | |
| var selected = selectionRects.map(function (r) { | |
| return viewport.convertToPdfPoint(r.left - pageRect.x, r.top - pageRect.y).concat( | |
| viewport.convertToPdfPoint(r.right - pageRect.x, r.bottom - pageRect.y)); | |
| }); |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
| { | |
| "AL": "Alabama", | |
| "AK": "Alaska", | |
| "AS": "American Samoa", | |
| "AZ": "Arizona", | |
| "AR": "Arkansas", | |
| "CA": "California", | |
| "CO": "Colorado", | |
| "CT": "Connecticut", | |
| "DE": "Delaware", |
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |