This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Parse a provisioning profile | |
# Extract the first DeveloperCertificates <data> entry | |
# Remove any leading whitespace | |
# Remove any blank lines | |
# Base64 decode the blob | |
# Parse the .cer with OpenSSL | |
# Extract the first line, which is the certificate subject (the rest is the cert blob) | |
# End up with a string like: subject= /UID=AABBCCDDEE/CN=iPhone Developer: First Last (FFGGHHIIJJ)/C=US | |
# Note: Uses xmlstarlet to parse the plist, but you could probably use PlistBuddy or grep, too |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Based in part on https://wincent.com/wiki/Fixing_the_baseline_on_the_Consolas_font_on_OS_X | |
function fail() | |
{ | |
local error=${1:-Unknown error} | |
echo "Failed! $error" | |
exit 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const { ApolloServer, gql } = require('apollo-server-express'); | |
const graphqlHTTP = require('express-graphql'); | |
const typeDefs = gql` | |
type Query { | |
hello: String | |
} | |
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const { ApolloServer, gql } = require('apollo-server-express'); | |
const { typeDefs, resolvers } = require('./schema'); | |
// https://www.apollographql.com/docs/apollo-server/features/graphql-playground.html#Enabling-GraphQL-Playground-in-production | |
const server = new ApolloServer({ | |
typeDefs, | |
resolvers, | |
introspection: true, | |
playground: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import RPi.GPIO as GPIO | |
import asyncio | |
import sys | |
PIN = 18 | |
def handle_edge(pin): | |
print('Edge callback') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ctype.h> | |
#include <errno.h> | |
#include <stdarg.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/stat.h> | |
struct Archive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cargo n64 build --ipl3 ./ipl3.bin --package hello-ipl3font | |
Building with cargo xbuild | |
Updating crates.io index | |
Compiling compiler_builtins v0.1.28 | |
Compiling core v0.0.0 (/Users/me/.rustup/toolchains/nightly-2020-02-16-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore) | |
Compiling rustc-std-workspace-core v1.99.0 (/Users/me/.rustup/toolchains/nightly-2020-02-16-x86_64-apple-darwin/lib/rustlib/src/rust/src/tools/rustc-std-workspace-core) | |
error[E0635]: unknown feature `llvm_asm` | |
--> /Users/me/.cargo/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.28/src/lib.rs:3:12 | |
| | |
3 | #![feature(llvm_asm)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rustc --version | |
rustc 1.45.0-nightly (a74d1862d 2020-05-14) | |
$ cargo xbuild --version | |
cargo-xbuild 0.5.31 | |
$ cargo n64 build --ipl3 ipl3.bin --package hello-ipl3font --verbose | |
Building with cargo xbuild | |
+ "cargo" "xbuild" "--message-format=json" "--target=/var/folders/j3/7pf540td3xncn7jdqtb62_ph00058y/T/n64-build/mips-nintendo64-none.json" "--package" "hello-ipl3font" "--verbose" "--release" | |
WARNING: There is no root package to read the cargo-xbuild config from. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/env python | |
# "SMAKN LCUS-1 type USB relay module USB intelligent control switch USB switch" | |
# https://www.amazon.com/gp/product/B01CN7E0RQ/ | |
# pipenv install pyserial | |
import serial | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ begin = '(^[ \t]+)?(?=<(?i:template lang="pug")(?!-))'; | |
end = '(?!\G)([ \t]*$\n?)?'; | |
beginCaptures = { 1 = { name = 'punctuation.whitespace.embedded.leading.html'; }; }; | |
endCaptures = { 1 = { name = 'punctuation.whitespace.embedded.trailing.html'; }; }; | |
patterns = ( | |
{ name = 'meta.embedded.block.html'; | |
begin = '(?i)(<)(template)(?=\s|/?>)'; | |
end = '(?i)((<)/)(template)\s*(>)'; | |
beginCaptures = { | |
0 = { name = 'meta.tag.metadata.pug.start.html'; }; |