Skip to content

Instantly share code, notes, and snippets.

View tralamazza's full-sized avatar

Daniel Tralamazza tralamazza

View GitHub Profile
FSM := source? start_state class_name header_file? include_file*
package_name* import* declare* access* map+
source := '%{' raw_code '%}'
start_state := '%start' word
class_name := '%class' word
header_file := '%header' raw_code_line
sudo ln -s `which python3` /usr/local/bin/python
@tralamazza
tralamazza / cemu.md
Last active February 7, 2018 22:29
CEMU install
@tralamazza
tralamazza / Dockerfile
Last active February 16, 2018 22:35
embedded dev container
FROM base/devel
ENV XTENSA_TOOLCHAIN xtensa-esp32-elf-linux64-1.22.0-75-gbaf03c2-5.2.0
# init
RUN pacman -Suy --noconfirm
RUN pacman-key --init && \
update-ca-trust && \
pacman-db-upgrade
// @see https://www.avespeak.com/index.php?title=Choocher
object APIChoocher {
const val BASE_URL = "https://jsonplaceholder.typicode.com"
suspend fun posts(): JSONObject = request("api/posts")
suspend fun post(id: String): JSONObject = request("api/posts/$id")
suspend fun postCreate(title: String, body: String, userId: Int): JSONObject =
request("api/posts", Request.Method.POST, JSONObject(mapOf("title" to title, "body" to body, "userId" to userId)))
/**
package io.matchx.lpwancontroller.api
import android.app.IntentService
import android.content.Intent
import android.support.v4.content.LocalBroadcastManager
import java.io.DataInputStream
import java.io.File
import java.io.FileOutputStream
import java.net.URL
const express = require('express')
const bodyParser = require('body-parser')
const jwt = require('jsonwebtoken')
const mongoose = require('mongoose')
const User = require('./models/user')
mongoose.Promise = global.Promise
mongoose.connect('mongodb://localhost/mock_server', { useMongoClient: true });
const app = express()
mixer custom
mmix reset
mmix 0 1 -1 0.796 -1
mmix 1 1 -1 -0.796 1
mmix 2 1 1 0.796 1
mmix 3 1 1 -0.796 -1
#!/bin/bash
if [[ "$#" -lt 1 ]];
then
echo "Usage: $0 certificate-name [certs subfolder]"
exit 1
fi
NAME=$1
import CoreData
extension NSManagedObject {
convenience public init(insertInto context: NSManagedObjectContext?) {
let name = String(describing: type(of: self))
let entity = NSEntityDescription.entity(forEntityName: name, in: context!)
self.init(entity: entity!, insertInto: context)
}
}