Skip to content

Instantly share code, notes, and snippets.

Avatar

Ian McKellar ianloic

View GitHub Profile
View blink.pcf
View pulse.py
import typing, math
from nmigen import *
from nmigen.build import Platform
from nmigen.back.pysim import Simulator, Delay
class Pulse(Elaboratable):
def __init__(self,
frequency: float,
clock_frequency: typing.Optional[float],
View strace-deps
#!/bin/bash
if [[ $# -lt 2 ]]; then
echo "Usage: $0 <depfile> <command...>" >&2
exit 1
fi
# The .d file we're going to write.
DEPSFILE=$1
shift
@ianloic
ianloic / Makefile
Created Sep 7, 2019
fontconfig is easy
View Makefile
CFLAGS=$(shell pkg-config --cflags fontconfig)
LDFLAGS=$(shell pkg-config --libs fontconfig)
example: example.o
View error.html
<html>
<head>
<title>No Tunnel</title>
</head>
<body>
<h1>No Tunnel</h1>
<p>There is no tunnel configured for <i><script>document.write(location.host)</script></i>...</p>
<p>Create a tunnel with:
<code>
@ianloic
ianloic / crashypants.cc
Last active Mar 3, 2020
Why is this wrong?
View crashypants.cc
#include <iostream>
#include <string>
#include <vector>
void test_string_vector() {
std::vector<std::string> v;
const char* one = v.emplace_back("one").data();
std::cout << "added one" << std::endl;
std::cout << "v.capacity() = " << v.capacity() << std::endl;
@ianloic
ianloic / hello-rdl.rb
Created Sep 24, 2018
Various hellos world.
View hello-rdl.rb
require 'rdl'
require 'types/core'
extend RDL::Annotate
type '(String) -> nil', typecheck: :now
def greet(name)
puts "hello, #{name}."
end
View main.dart
import 'dart:async';
class AsyncProxyController<T> {
}
class AsyncProxy<T> {
AsyncProxyController<T> ctrl;
}
View events.dart
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// WARNING: This file is machine generated by fidlgen.
library fidl_fidl_examples_events$async;
import 'dart:async';
import 'dart:typed_data';
View main.dart
import 'dart:async';
import 'other.dart' show Error;
abstract class Wlan {
Future<Error> method();
}
class WlanFuturize {
final Wlan _inner;
You can’t perform that action at this time.