Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am antonl on github.
  • I am aloukian (https://keybase.io/aloukian) on keybase.
  • I have a public key ASDfbiDVp6PrF9hVGyK-3DuCF9vHS2KHI408vLzUpiLlAwo

To claim this, I am signing this object:

@antonl
antonl / config.py
Created January 22, 2016 16:46
Glueviz config file for opening transient grating datasets
from glue.config import data_factory
from glue.core import Data, Component
from h5py import File
import numpy as np
def is_nudie_file(filename, **kwargs):
'''checks that the given file is a nudie file'''
if not filename.endswith('.h5'):
return False
@antonl
antonl / pyqt4-example-main.py
Last active August 29, 2015 14:24
PyQt4 Ui Example
from __future__ import print_function, unicode_literals
import sys
from PyQt4 import QtGui, QtCore
from main_ui import Ui_MainWindow
import subprocess
class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
def __init__(self, parent=None):
QtGui.QMainWindow.__init__(self, parent)
self.setupUi(self)
@antonl
antonl / make-figure.py
Created May 29, 2015 15:24
Persistent oscillation in PIXIS cameras
from winspec import SpeFile
from pathlib import Path
from matplotlib.pylab import *
from scipy.signal import argrelmax
# Period of sampling in seconds
regen_period = 0.001*2
# Change the path to load the SPE file
file_path = Path('./100BRX-800fs.SPE')
# tags for phase cycles
phase_cycles = [0, 1, 0.6, 1.6, 1.3, 2.3]
# subspaces
sub1, sub2 = np.zeros((3,3), dtype=complex), np.zeros((3,3), dtype=complex)
sub1 = np.array([[np.exp(1j*np.pi*(x)), np.exp(1j*np.pi*(-x)), 1] for x in phase_cycles[0::2]])
sub2 = np.array([[np.exp(1j*np.pi*(x)), np.exp(1j*np.pi*(-x)), 1] for x in phase_cycles[1::2]])
# Full matrix
C = np.kron(np.array([[1, 0], [0, 0]]), sub1) + np.kron(np.array([[0, 0], [0, 1]]), sub2)
@antonl
antonl / simple.cpp
Last active June 22, 2018 14:49
Qt Threads and StateMachine
#include <QObject>
#include <QState>
#include <QStateMachine>
#include <QThread>
#include <QApplication>
#include <QDebug>
#include <QTimer>
// Worker Object
class Worker : public QStateMachine
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
#ifndef sbi
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
#endif
#include <avr/pgmspace.h>
unsigned char byte_n = 0; // byte count
@antonl
antonl / .vimrc
Created May 6, 2013 02:09
My vimrc file
"
" VIM Configuration
"
" Anton Loukianov
"
" Updated 2 Mar 2011
" Turn off compatible mode
set nocompatible
@antonl
antonl / configure.in.diff
Created July 8, 2012 07:02
Slightly edited wxWidgets upstream patch that removes Quicktime framework from x86_64 builds
Index: ./
===================================================================
--- configure (revision 70960)
+++ configure (revision 71086)
@@ -51726,5 +51726,65 @@
EXTRA_FRAMEWORKS="-framework IOKit -framework UIKit -framework CFNetwork -framework AudioToolbox -framework CoreFoundation -framework CoreGraphics -framework OpenGLES -framework Foundation -framework QuartzCore"
else
- EXTRA_FRAMEWORKS="-framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL -framework QuickTime"
+ EXTRA_FRAMEWORKS="-framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL"
+