Skip to content

Instantly share code, notes, and snippets.

@KhashayarDanesh
KhashayarDanesh / set-up-chromium-keys.md
Last active June 9, 2022 07:40 — forked from cvan/set-up-chromium-keys.md
Launch Chromium with API Keys on Linux, macOS and Windows

Sometimes you need to use API Keys to use things like the Speech API. And then you Google a bit and follow all the instructions. But the Chromium Project's API Keys page does a not-so-great of explaining how to do this, so I will.

1. Download Chromium.

2. You'll notice a yellow disclaimer message appear as a doorhanger: Google API Keys are missing. Some functionality of Chromium will be disabled. Learn More.

3. Clicking on that link takes you to the confusing API Keys docs page.

4. If you aren't already, subscribe to the [email protected] mailing list. (You can just subscribe to the list and choose to not receive any mail. FYI: the Chromium project restricts the APIs to those subscribed to that group - that is, Chromium

@orta
orta / rfc.md
Last active February 20, 2024 02:23
A proposal for improving TS2322 error messages

This is a work in progress. Please don't take this as something that will definitely happen, we all know what happens to well laid plans and I need to present it to the rest of the TypeScript team in order to figure out a lot of feasibility questions.

Intro

The examples in this PR assumes [CLI DX] Improve positioning of compiler error messaging info #45717 is merged

In 4.4, all diagnostic messages from TypeScript are treated the same, we have a massive .JSON file of ±2000 diagnostic messages which are used everywhere from compiler messages to CLI help. Aside from some simple string manipulation, these are effectively what we output for all error messages. I'd like to propose that we break this pattern, just for error TS2322.

TS2322 is our 'type x is not assignable to y' error, you'd see it for const str: string = 123 and I expect it is the most seen

@orta
orta / tsc-compiler-errors-3.svg
Last active September 6, 2021 10:25
Ideas for TSC with prettier pretty settings - click raw on this svg below
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@niw
niw / LICENSE
Last active May 14, 2023 15:35
macOS Big Sur Icon Template for Affinity Photo
macOS Big Sur Icon Template for Affinity Photo (c) by Yoshimasa Niwa
macOS Big Sur Icon Template for Affinity Photo is licensed under a
Creative Commons Attribution 4.0 International License.
You should have received a copy of the license along with this
work. If not, see <http://creativecommons.org/licenses/by/4.0/>.
@Manouchehri
Manouchehri / ieee754.js
Created October 13, 2017 19:00 — forked from bartaz/gist:1119041
Convert JavaScript number to string of 64bit double precision floating point representation (IEEE 754)
// Convert a JavaScript number to IEEE-754 Double Precision
// value represented as an array of 8 bytes (octets)
//
// http://cautionsingularityahead.blogspot.com/2010/04/javascript-and-ieee754-redux.html
function toIEEE754(v, ebits, fbits) {
var bias = (1 << (ebits - 1)) - 1;
// Compute sign, exponent, fraction
@4np
4np / ambientLightSensor.swift
Created January 24, 2017 23:33
Acces Mac OS Ambient Light Sensor
func getLux() {
guard let serviceType = IOServiceMatching("AppleLMUController") else {
debugPrint("No ambient light sensor")
return
}
// get and release service
let service = IOServiceGetMatchingService(kIOMasterPortDefault, serviceType)
defer {
IOObjectRelease(service)
@tomysmile
tomysmile / mac-setup-redis.md
Last active October 31, 2024 21:46
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@rdavisau
rdavisau / dark-style-from-vs-2015.json
Created February 25, 2016 04:26
dark-style-from-vs-2015.json
{
"name":"dark-style-from-vs-2015",
"version":"1.0",
"description":"Imported color scheme",
"originator":"Imported from /Users/rdavis/Library/XamarinStudio-5.0/HighlightingSchemes/dark-style-from-vs-2015.vssettings",
"colors":[
{"name": "Background(Read Only)", "color":"#1E1E1E" },
{"name": "Search result background", "color":"#005F60" },
{"name": "Search result background (highlighted)", "color":"#007F80" },
{"name": "Fold Square", "color":"#A5A5A5" },
@bcoles
bcoles / Life.HC.Z
Last active August 28, 2022 17:37
Conway's Game of Life in HolyC for TempleOS. Ported from Rosetta Code. Original C Source: http://rosettacode.org/wiki/Conway's_Game_of_Life#C
// Conway's Game of Life in HolyC for TempleOS
// Ported from Rosetta Code. Original C Source:
// - http://rosettacode.org/wiki/Conway's_Game_of_Life#C
#define WIDTH 60
#define HEIGHT 40
#define SLEEP 100
U32 Universe[HEIGHT][WIDTH];
U64 COUNT;
@Peter-Juhasz
Peter-Juhasz / vs.css
Last active August 18, 2016 19:50
Visual Studio Theme for Monaco Editor
.monaco-editor .current-line {
background: none !important;
border: none !important;
}
.monaco-editor .cursors-layer > .cursor {
width: 1px !important;
}
.monaco-editor .bracket-match {