View gist:3730341
// Read a text file into an array | |
// | |
// Text File: | |
// ---------- | |
// Apple | |
// Banana | |
// Carrot | |
// Dragon Fruit | |
// Eggplant |
View gist:3730350
var url = "http://server.com/text/vegetables.txt" | |
$.get(url, | |
function(data) { | |
vegetables = data.split('n'); | |
doSomething(vegetables); | |
}, | |
"text" | |
); |
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, |
View SimpleSpotifyPlayPause.scpt
tell application "Spotify" to playpause |
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) |
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 |
View cx23885.conv
options cx23885 card=56 |
View create_cx23885-conf.sh
echo "options cx23885 card=56" | sudo tee /etc/modprobe.d/cx23885.conf |
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 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') |
OlderNewer