Skip to content

Instantly share code, notes, and snippets.

@zeux
zeux / clang27.md
Last active January 27, 2024 11:45
How does clang 2.7 hold up in 2021?

A friend recently learned about Proebsting's law and mentioned it to me off hand. I knew about the law's existence but I never really asked myself - do I believe in it?

For people who aren't aware, Proebsting's law states:

Compiler Advances Double Computing Power Every 18 Years

Which is to say, if you upgrade your compiler every 18 years, you would expect on average your code to double in performance on the same hardware.

Let's C about this

@EvanBacon
EvanBacon / apple-touch-startup-image.html
Created April 17, 2019 07:10
An example of full iOS PWA startup image (splash screen) support.
<html>
<head>
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-touch-fullscreen" content="yes" />
<meta name="apple-mobile-web-app-title" content="Expo" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<link
rel="apple-touch-icon"
sizes="180x180"
@mattpodwysocki
mattpodwysocki / flatmap.ts
Last active May 15, 2017 00:45
Implementations of `flatten` and `flatMap` as described in the [ES Proposal](https://bterlson.github.io/proposal-flatMap/)
'use strict';
import { bindCallback } from '../internal/bindcallback';
export async function *flatMapAsync<TSource, TResult>(
source: AsyncIterable<TSource>,
fn: (value: TSource) => AsyncIterable<TResult>,
thisArg?: any): AsyncIterable<TResult> {
let sel = bindCallback(fn, thisArg, 1);
for await (let outerItem of source) {
--[[
* Copyright (c) 2011-2016 - Ashita Development Team
*
* Ashita is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Ashita is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@j8
j8 / disable all macos animations
Last active March 28, 2024 10:18
disable all macos animations for high performance
defaults write -g NSScrollViewRubberbanding -int 0
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false
defaults write -g NSScrollAnimationEnabled -bool false
defaults write -g NSWindowResizeTime -float 0.001
defaults write -g QLPanelAnimationDuration -float 0
defaults write -g NSScrollViewRubberbanding -bool false
defaults write -g NSDocumentRevisionsWindowTransformAnimation -bool false
defaults write -g NSToolbarFullScreenAnimationDuration -float 0
defaults write -g NSBrowserColumnAnimationSpeedMultiplier -float 0
defaults write com.apple.dock autohide-time-modifier -float 0
@ihnorton
ihnorton / ex.cs
Last active November 30, 2023 19:52
Simple example of calling Julia from C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
namespace ConsoleApplication1
{
class Program
Below I collected relevant links and papers more or less pertaining to the subject of tetrahedral meshes.
It's an ever-growing list.
------------------------------
Relevant links:
http://en.wikipedia.org/wiki/Types_of_mesh
http://en.wikipedia.org/wiki/Tetrahedron
http://en.wikipedia.org/wiki/Simplicial_complex
/**
* Cycle detection function
* Outputs count and grouped cycles with a from key path and to key path.
* The executing browser should have console.group and .groupEnd functions.
*
* Based on:
* http://stackoverflow.com/questions/14962018/detecting-and-fixing-circular-references-in-javascript/14962496#14962496
*
* @param {Object} obj Any js object
* @return {void}
@jo
jo / js-crypto-libraries.md
Last active March 31, 2024 20:33
List of JavaScript Crypto libraries.

JavaScript Crypto Libraries

List some crypto libraries for JavaScript out there. Might be a bit out dated. Scroll to the bottom.

WebCryptoAPI

http://www.w3.org/TR/WebCryptoAPI/

This specification describes a JavaScript API for performing basic cryptographic operations in web applications, such as hashing, signature generation and verification, and encryption and decryption. Additionally, it describes an API for applications to generate and/or manage the keying material necessary to perform these operations. Uses for this API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.

@mericson
mericson / loadUrl.jsx
Created September 10, 2013 14:13
Loads data from a URL in Adobe Illustrator! (Uses Bridge behind the scenes)
var doc = app.activeDocument;
var docPath = doc.path;
function loadUrl(url, callback) {
var bt = new BridgeTalk();
bt.target = 'bridge' ;