Skip to content

Instantly share code, notes, and snippets.

Schlameel schlameel

  • US
Block or report user

Report or block schlameel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@schlameel
schlameel / deinterleave.py
Last active Jun 9, 2017
De-interleave data using numpy
View deinterleave.py
import numpy as np
CHANNEL_COUNT = 2
frames = np.array([0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1])
deinterleaved = [frames[idx::CHANNEL_COUNT] for idx in range(CHANNEL_COUNT)]
print(deinterleaved[0])
# prints "[0 0 0 0 0 0 0 0 0 0]"
print(deinterleaved[1])
# prints "[1 1 1 1 1 1 1 1 1 1]"
@schlameel
schlameel / interleave.py
Last active Jun 9, 2017
Interleave data using numpy
View interleave.py
import numpy as np
arr1 = np.zeros(100)
arr2 = np.ones(100)
arr_tuple = (arr1, arr2)
interleaved = np.vstack(arr_tuple).reshape((-1,), order='F')
@schlameel
schlameel / upgrade-kernel-4_9.sh
Created Apr 15, 2017
Upgrade the kernel on Ubuntu to 4.9
View upgrade-kernel-4_9.sh
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.9/linux-headers-4.9.0-040900_4.9.0-040900.201612111631_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.9/linux-headers-4.9.0-040900-generic_4.9.0-040900.201612111631_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.9/linux-image-4.9.0-040900-generic_4.9.0-040900.201612111631_amd64.deb
sudo dpkg -i *.deb
View create_cx23885-conf.sh
echo "options cx23885 card=56" | sudo tee /etc/modprobe.d/cx23885.conf
@schlameel
schlameel / copy_firmare.sh
Created Apr 14, 2017
Copy the firmware to the firmware directory
View copy_firmare.sh
wget https://github.com/OpenELEC/dvb-firmware/raw/master/firmware/dvb-demod-si2168-b40-01.fw
sudo cp dvb-demod-si2168-b40-01.fw /lib/firmware
@schlameel
schlameel / JsonClsExample.py
Created Sep 5, 2016
A simple example of the usage of JsonCls available at https://github.com/schlameel/JsonCls
View JsonClsExample.py
class Character(JsonCls):
name = Member()
actor = Member()
film = Member()
json_str = "{ 'name' : 'Dead Collector',
'actor' : 'Eric Idle',
'film' : 'Monty Python and the Holy Grail' }
character = Character().json(json_str)
@schlameel
schlameel / SimpleSpotifyPlayPause.scpt
Last active Aug 29, 2015
Simple Spotify play/pause Applescript
View SimpleSpotifyPlayPause.scpt
tell application "Spotify" to playpause
View SpotifyPlayPause.scpt
#!/usr/bin/osascript
-- SpotifyPlayPause
-- Copyright 2015 Schlameel
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
@schlameel
schlameel / gist:3730350
Created Sep 15, 2012
JQuery.get() Text
View gist:3730350
var url = "http://server.com/text/vegetables.txt"
$.get(url,
function(data) {
vegetables = data.split('n');
doSomething(vegetables);
},
"text"
);
You can’t perform that action at this time.