This file contains 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
TEST_DRIVER=$1 | |
TEST_DIR=$2 | |
PASSED=0 | |
FAILED=0 | |
if [ -z $TEST_DRIVER ] || [ -z $TEST_DIR ]; then | |
echo "Usage: $0 <test driver> <test directory>" | |
else | |
for f in $( ls $TEST_DIR/*.py ); do | |
TOTAL=$[TOTAL+1] | |
echo "__________________________________" |
This file contains 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
#look for a tag... | |
exec_program( | |
"git" | |
${CMAKE_CURRENT_SOURCE_DIR} | |
ARGS "describe" | |
OUTPUT_VARIABLE GIT_TAG ) | |
#...if not found get the SHA1 hash instead | |
if( ${GIT_TAG} MATCHES "fatal:.*" ) | |
exec_program( |
This file contains 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
cmake_minimum_required(VERSION 2.8) | |
project(qpy) | |
#Qt | |
find_package(Qt4 REQUIRED QtCore) | |
include(${QT_USE_FILE}) | |
#Python | |
find_package(PythonLibs) | |
include_directories( ${PYTHON_INCLUDE_DIRS} ${QT_INCLUDES} ) |
This file contains 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
// use with qmetaobject-newinstance.cpp | |
#include <iostream> | |
#include <QObject> | |
#include <QString> | |
#include <QVariantMap> | |
#include <QVariantList> | |
#include <QList> | |
#include <QVector> |
This file contains 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
import struct | |
import SocketServer | |
from base64 import b64encode | |
from hashlib import sha1 | |
from mimetools import Message | |
from StringIO import StringIO | |
class WebSocketsHandler(SocketServer.StreamRequestHandler): | |
magic = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11' |
This file contains 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
(ns apples.core | |
(:require [play-clj.core :refer :all] | |
[play-clj.g2d :refer :all] | |
[play-clj.math :refer :all])) | |
(declare apples main-screen) | |
(def speed 14) | |
(defn- get-direction [] | |
(cond |
This file contains 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
FROM STACK OVERFLOW | |
http://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome | |
$ open -a Google\ Chrome --args --disable-web-security | |
For Linux run: | |
$ google-chrome --disable-web-security | |
Also if you're trying to access local files for dev purposes like AJAX or JSON, you can use this flag too. | |
-–allow-file-access-from-files |
This file contains 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
# ffmpeg -i file.mp4 -y -ss 5 -an -sameq -f image2 -r 1/5 filename%03d.jpg | |
-y | |
Overwrite output files | |
-ss position | |
Seek to given time position in seconds. "hh:mm:ss[.xxx]" syntax is also supported | |
-an | |
Disable audio recording |
This file contains 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
#!/bin/sh | |
#NOTE: need to set L to the proper libcef_dll top level dir: ../out/Release/obj.target | |
g++ -I../ -o qt qt.cpp cefw.cpp `pkg-config --cflags gtk+-2.0` \ | |
`pkg-config --libs gdk-2.0` \ | |
-L../out/Release/obj.target -L../Release -lcef_dll_wrapper -lcef `pkg-config --cflags QtCore QtGui --libs QtCore QtGui` |
This file contains 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
//sync queue implementation | |
#pragma once | |
#include <condition_variable> | |
#include <mutex> | |
#include <deque> | |
//------------------------------------------------------------------------------ | |
//synchronized queue (could be an inner class inside Executor): | |
// - acquire lock on insertion and notify after insertion | |
// - on extraction: acquire lock then if queue empty wait for notify, extract |
NewerOlder