Skip to content

Instantly share code, notes, and snippets.

View nunb's full-sized avatar
🎯
Focusing

none-p nunb

🎯
Focusing
View GitHub Profile
from __future__ import print_function
import matplotlib
import matplotlib.pyplot as plt
import tensorflow as tf
import time
def get_times(maximum_time):
device_times = {
"/gpu:0":[],
@nunb
nunb / git_stat.py
Created May 26, 2017 02:51 — forked from kennyballou/git_stat.py
Git Statistics from `git log --format='%H|%ai|%aN|%aE' --reverse`
#!/usr/bin/env python
'''Git Statistics'''
import argparse
import sys
from datetime import datetime
from datetime import timedelta
from datetime import tzinfo
class UTC(tzinfo):
@nunb
nunb / nock.lisp
Created May 22, 2017 04:01 — forked from BusFactor1Inc/nock.lisp
A Nock Interpreter and Compiler in Common Lisp #Urbit
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; nock.lisp - The Interpretation and Compilation of Nock Programs.
;;
;; Nock is the Maxwell's Equations of Software. It is a language that
;; powers the Urbit virtual machine; its specification can fit on a
;; t-shirt[1].
;;
;; In this set of Common Lisp functions below are 'tar',
;; a Nock interpreter, 'dao', a Nock compiler and 'phi',
;; a Nock compiler driver.
@nunb
nunb / MPU6050TeapotDemoKC
Created May 14, 2017 16:53 — forked from kcranley1/MPU6050TeapotDemoKC
My first Processing script to run the MPU6050 3-axis Gyro & Accelerometer (needs Arduino sketch also)
// I2C device class (I2Cdev) demonstration Processing sketch for MPU6050 DMP output
// 6/20/2012 by Jeff Rowberg <jeff@rowberg.net>
// Updates should (hopefully) always be available at https://github.com/jrowberg/i2cdevlib
//
// Changelog:
// 2012-06-20 - initial release
/* ============================================
I2Cdev device library code is placed under the MIT license
Copyright (c) 2012 Jeff Rowberg
@nunb
nunb / whatsapp_phone_enumerator_floated_div.js
Created May 12, 2017 10:41
PoC WhatsApp enumeration of phonenumbers, profile pics, about texts and online statuses (floated div)
/*
PoC WhatsApp enumeration of phonenumbers, profile pics, about texts and online statuses
Floated div edition
01-05-2017
(c) 2017 - Loran Kloeze - loran@ralon.nl
This script creates a UI on top of the WhatsApp Web interface. It enumerates certain kinds
of information from a range of phonenumbers. It doesn't matter if these numbers are part
of your contact list. At the end a table is displayed containing phonenumbers, profile pics,
about texts and online statuses. The online statuses are being updated every
@nunb
nunb / min-char-rnn.py
Created May 12, 2017 01:30 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)

Where you able to produce a binary directly from the Rust build tools that you could submit to the app/play store?


Not quite, but I tried to get as close to that as was reasonably possible. Alas, things ended up a little convoluted.

For iOS, I have a nearly empty Xcode project with a build script that copies my cargo produced executable into the .app that Xcode generates (before Xcode signs it). The build script also uses lipo to merge the executables for each architecture I’m targeting (e.g. armv7 and aarch64 for non-simulator devices) into a single, universal binary.

On top of that, there are various iOS-y things that need to happen before my application’s main method is called. SDL2 provides the Objective-C code that does all of that. In a C or C++ game, SDL2 renames main to SDL_main, and then [inserts its own mai

@nunb
nunb / DeepResidualNetMxNet.py
Created April 25, 2017 04:26 — forked from erogol/DeepResidualNetMxNet.py
DeepResidualNet model defined by mxnet
# coding: utf-8
# # DressRank traning
# In[ ]:
import mxnet as mx
from mxnet.utils import *
import logging
@nunb
nunb / Makefile
Created April 9, 2017 15:55 — forked from uxp/Makefile
# Makefile for blink demo
#TOOLS = arm-linux-gnu
TOOLS = arm-none-eabi
# Assembling with gcc makes it want crt0 at link time.
#AS = $(TOOLS)-gcc
AS = $(TOOLS)-as
# Use the -g flag if you intend to use gdb
#CC = $(TOOLS)-gcc -mcpu=cortex-m3 -mthumb
@nunb
nunb / macOS_launcher.sh
Created March 13, 2017 07:34 — forked from StefanoBelli/macOS_launcher.sh
Fast OS X launch on QEMU with KVM support enabled. Credits to: https://github.com/kholia, original repository: https://github.com/kholia/OSX-KVM
#!/bin/sh
# qemu-img create -f qcow2 mac_hdd.img 64G
# echo 1 > /sys/module/kvm/parameters/ignore_msrs
#
# Type the following after boot,
# -v "KernelBooter_kexts"="Yes" "CsrActiveConfig"="103"
#
# printf 'DE:AD:BE:EF:%02X:%02X\n' $((RANDOM%256)) $((RANDOM%256))
#