Skip to content

Instantly share code, notes, and snippets.

[package]
name = "pingserver"
version = "0.1.0"
edition = "2018"
[dependencies]
tide = "0.16.0"
async-std = { version = "1.8.0", features = ["attributes"] }
serde = { version = "1.0.126", features = ["derive"] }
chrono = "0.4.19"
// build: c++ -std=c++14 fizzbuzz.js.cpp
#include <iostream>
#define function auto
#define var auto
class Console {
public:
void log(std::string msg) {
std::cout << msg << std::endl;
@badboy
badboy / ios-simulat-tier2.md
Created April 30, 2021 16:06
rust: Moving aarch64-apple-ios-sim to Tier 2

Proposal

I propose to move the aarch64-apple-ios-sim target to Tier 2. That target was introduced in PR #81966, by @deg4uss3r and myself.

Currently to build libraries/applications for iOS and run them in the iOS simulator on aarch64 macOS hardware one can use Nightly and build with -Z build-std --target aarch64-apple-ios-sim.

The aarch64-apple-ios-sim targets the iOS simulator on macOS aarch64 machines. It is similar to the already existing x86_64-apple-ios target (which is Tier 2). It is required because aarch64-apple-ios is only for iOS hardware.

#!/usr/bin/tclsh
#
# Usage: git-unmerged branch1 branch2
#
# description: Shows all the non-common commits in the two branches
#
# Shows all the non-common commits in the two branches, where non-common
# commits means simply commits with a unique commit *message*.
proc getlog branch {
.section __TEXT,__text,regular,pure_instructions
.build_version macos, 11, 0
.globl __ZN100_$LT$core..str..iter..SplitTerminator$LT$P$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h2e7be39e5c102055E ; -- Begin function _ZN100_$LT$core..str..iter..SplitTerminator$LT$P$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h2e7be39e5c102055E
.p2align 2
__ZN100_$LT$core..str..iter..SplitTerminator$LT$P$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h2e7be39e5c102055E: ; @"_ZN100_$LT$core..str..iter..SplitTerminator$LT$P$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h2e7be39e5c102055E"
.cfi_startproc
; %bb.0:
stp x29, x30, [sp, #-16]! ; 16-byte Folded Spill
.cfi_def_cfa_offset 16
.cfi_offset w30, -8
0:10.83 warning: unused variable: `v`
0:10.83 --> /home/jer/mozilla/src/gecko/obj/toolkit/components/glean/api/src/metrics.rs:411:64
0:10.83 |
0:10.83 411 | let extra = extra.map(|m| m.into_iter().map(|(k, v)| (k.try_into().unwrap(), v)).collect());
0:10.83 | ^ help: if this is intentional, prefix it with an underscore: `_v`
0:10.83 |
0:10.83 = note: `#[warn(unused_variables)]` on by default
0:10.83 warning: 1 warning emitted
#![feature(prelude_import)]
#![feature(generators, generator_trait, try_trait)]
#[prelude_import]
use std::prelude::v1::*;
#[macro_use]
extern crate std;
fn fizz_buzz() -> (impl Iterator<Item = String>) {
let __ret = || {
{
@badboy
badboy / hkt.rs
Created March 26, 2016 11:33 — forked from 14427/hkt.rs
Higher-kinded type trait
use std::rc::Rc;
pub trait HKT<U> {
type C; // Current type
type T; // Type with C swapped with U
}
macro_rules! derive_hkt {
($t:ident) => {
impl<T, U> HKT<U> for $t<T> {
#![feature(optin_builtin_traits, negative_impls)]
use std::marker::PhantomData;
auto trait NotSame{}
impl<A> !NotSame for (A, A) {}
struct Is<S, T>(PhantomData<(S,T)>);
impl<S,T> Is<S,T> where (S,T): NotSame {
local wf = hs.window.filter
local zoomWins = wf.new(false):setAppFilter('zoom.us')
zoomWins:subscribe(wf.windowCreated, function(window)
local builtin = hs.screen.find("Color LCD")
window:moveToScreen(builtin)
end)