Skip to content

Instantly share code, notes, and snippets.

@nevsan
nevsan / Asana Export.ipynb
Last active November 16, 2022 22:32
Export data from Asana
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nevsan
nevsan / assign_test.sv
Last active August 7, 2018 16:26
Modeling inertial delays
`timescale 1ns/1ps
module test_assign_test;
logic enable;
logic amp_up_orig;
logic block_up;
logic block_up_prev;
timeunit 1ns;
@nevsan
nevsan / git-rebase-submodule.py
Last active June 27, 2018 14:22
git-rebase-submodule
#!/usr/bin/env python
"""Rewrite history for the current branch if a submodule was recently rebased."""
doc = """Rewrite history for the current branch if a submodule was recently rebased.
The Situation
=============
You have made a series of commits on a feature branch, several of which contain updates to a
submodule. As time passes, you realize that you want to rebase yourthis submodule (say, to keep up
@nevsan
nevsan / test_tokenize.py
Last active March 23, 2017 04:13
Testing of lib2to3.pgen2.tokenize for Python 3.6
import re
# ----------------------------------------------------------------
# Define regular expressions
# ----------------------------------------------------------------
def group(*choices): return '(' + '|'.join(choices) + ')'
def maybe(*choices): return group(*choices) + '?'
Binnumber = r'0[bB]_?[01]+(?:_[01]+)*'
@nevsan
nevsan / init.el
Created October 24, 2016 03:33
Initialize Spacemacs inside your own .emacs.d
;;; init.el -- Main Emacs Initialization File
;;; Commentary:
;;; This file is loaded first by emacs if '~/.emacs' does not exist.
;;; Code:
;; Record the current value of 'user-emacs-directory' since we will be
;; overriding it later for spacemacs.
@nevsan
nevsan / json_numpy.py
Created July 25, 2015 03:00
JSON serialization support for NumPy ndarray objects.
from functools import partial
import io
import json
import numpy as np
def as_numpy(dct):
"""JSON decoder for NumPy ndarrays."""
if '__numpy__' in dct:
return np.load(io.BytesIO(dct['data'].encode('latin-1')))
return dct
@nevsan
nevsan / drawtiming.patch
Created May 6, 2014 04:35
Drawtiming patch
diff --git a/src/timing.h b/src/timing.h
index 62f9469..e9eece3 100644
--- a/src/timing.h
+++ b/src/timing.h
@@ -20,6 +20,7 @@
#ifndef __TIMING_H
#define __TIMING_H
#include <string>
+#include <strings.h>
#include <list>
@nevsan
nevsan / verilog-mode.diff
Created November 10, 2013 08:09
Search for 'verilog-library-files' relative to the current TRAMP path.
9560c9560,9569
< verilog-library-files)) ; finally, any libraries
---
> verilog-library-files ; finally, any libraries
> (let ((tramp-host ; also relative to current TRAMP path
> (ignore-errors
> (tramp-file-name-host
> (tramp-dissect-file-name buffer-file-name)))))
> (if tramp-host
> (mapcar (lambda (fname)
@nevsan
nevsan / mkoctfile_pass_options_further.diff
Created August 27, 2012 19:29
Octave patch (pass compiler arguments to mkoctfile)
diff --git a/src/mkoctfile.in b/src/mkoctfile.in
index 7a9e66f..5b28974 100644
--- a/src/mkoctfile.in
+++ b/src/mkoctfile.in
@@ -213,6 +213,10 @@ Options:
-W... Pass flags to the compiler such as -Wa,OPTION.
+ -f..., -m... Pass flags to the compiler, e.g. -ffast-math -march=native
+
@nevsan
nevsan / ecb_local-info_patch
Created September 6, 2011 15:51
Allows info to be installed locally...
diff --git a/Makefile b/Makefile
index 649657a..44b8f47 100644
--- a/Makefile
+++ b/Makefile
@@ -193,10 +193,10 @@ pdf: $(ecb_TEXI)
install-help: $(ecb_INFO_DIR)/$(ecb_INFO)
- @if test -x "$(INSTALLINFO)" -a -f "$(EMACSINFOPATH)/dir"; then\
+ @if test -x "$(INSTALLINFO)"; then\