This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def download_cover(url, name=None): | |
#print "========================== START" | |
#print "==== COVER URL: %s" % (url,) | |
purl = urlparse(url) | |
path = purl.path | |
if path.startswith('/'): | |
path = path[1:] | |
abspath = os.path.join(settings.MEDIA_ROOT,settings.RADIOPLAYLIST_COVERS_PREFIX,path) | |
relpath = os.path.join(settings.RADIOPLAYLIST_COVERS_PREFIX,path) | |
if not os.path.exists(os.path.dirname(abspath)): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import time | |
import signal | |
from subprocess import Popen, PIPE | |
dd = Popen(['dd'] + sys.argv[1:], stderr=PIPE) | |
while dd.poll() is None: | |
time.sleep(.3) | |
dd.send_signal(signal.SIGUSR1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pm list packages -f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NetworkTasksTest extends InstrumentationTestCase{ | |
public void testGetMedia() throws Throwable{ | |
final Context context = getInstrumentation().getTargetContext(); | |
final CountDownLatch signal = new CountDownLatch(1); | |
final NetworkTasks networkTasks = new NetworkTasks(context, new GetMediaListener(signal)); | |
runTestOnUiThread(new Runnable() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If tomorrow all the things were gone, | |
I’d worked for all my life. | |
And I had to start again, | |
with just my children and my wife. | |
I’d thank my lucky stars, | |
to be livin here today. | |
‘ Cause the flag still stands for freedom, | |
and they can’t take that away. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"encoding/json" | |
) | |
type Message struct { | |
Name string | |
Body string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"net/http" | |
) | |
type test_struct struct { | |
Test string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_list_circular(l): | |
slower = l | |
faster = l.get_next() | |
while True: | |
# if faster pointer finds a None element | |
# then the list is not circular | |
if (faster is None) or (faster.get_next() is None): | |
return False | |
# if faster element catch up with the slower |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum install fontconfig freetype freetype-devel fontconfig-devel libstdc++ | |
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2 | |
tar -xjvf ~/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2 --strip-components 1 /opt/phantomjs/ | |
sudo yum install libffi-devel openssl-devel | |
pip install pyopenssl pyasn1 | |
pip install requests[security] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SPI.h> | |
#include "Arduboy.h" | |
#include <EEPROM.h> | |
#include <avr/pgmspace.h> | |
Arduboy arduboy; | |
// frame counter | |
unsigned int frame = 0; |
OlderNewer