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
<div id="pano_viewer"> | |
<div id="cube_box"> | |
<div id="cube"> | |
<img class="front" src="http://s.cdpn.io/19243/front.JPG" width="3000" height="3000"> | |
<img class="left" src="http://s.cdpn.io/19243/left.JPG" width="3000" height="3000"> | |
<img class="right" src="http://s.cdpn.io/19243/right.JPG" width="3000" height="3000"> | |
<img class="back" src="http://s.cdpn.io/19243/back.JPG" width="3000" height="3000"> | |
<img class="top" src="http://s.cdpn.io/19243/up.JPG" width="3000" height="3000"> | |
<img class="bottom" src="http://s.cdpn.io/19243/down.JPG" width="3000" height="3000"> | |
</div> |
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
import atomac | |
a=atomac.getAppRefByLocalizedName('Skype') | |
cloud_menu = a.AXChildren[2].AXChildren[0] | |
print cloud_menu | |
# Some apps are coded so menu items aren't populated until they're displayed | |
try: | |
cloud_menu.Press() | |
except atomac.ErrorCannotComplete: | |
# An accessibility bug you'll see sometimes - the app never reports |
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/python | |
import socket | |
HOST = 'localhost' # use '' to expose to all networks | |
PORT = 515 | |
def incoming(host, port): | |
"""Open specified port and return file-like object""" | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
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/python | |
# receive udp packets from all interfaces | |
import socket | |
HOST = '' # use '' to expose to all networks | |
port = 5464 | |
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) |
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
>>> import atomac | |
>>> skype = atomac.getAppRefByLocalizedName('Skype') | |
>>> skype.findFirstR(AXRole='AXGrid').waitFor(10, 'AXResized') # type something in the current chat would result in its resizing | |
False |
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
import time | |
import threading | |
import pyperclip | |
import bitly | |
# fill you auth | |
bitlyAPI = bitly.Api(login='', apikey='') | |
def get_short_url(url): | |
return bitlyAPI.shorten(url, {'history':1}) |
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
# http://snipplr.com/view/19446/datetime-string-conversion/ | |
import datetime | |
d=datetime.datetime.now() | |
# datetime to string | |
print d.strftime("%d/%m/%Y %H:%M:%S") | |
# string to datetime | |
print d.strptime("14/11/1970 12:03:30","%d/%m/%Y %H:%M:%S") |
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
@import "compass/css3/images"; | |
// CSS-only multi-line ellipsis with generated content | |
// yields `position:relative`, so remember to declare an eventual `position:absolute/fixed` *after* including this mixin | |
@mixin limitLines( | |
$maxLinesPortrait, // Mandatory: The number of lines after which the clipping should take action. | |
$maxLinesLandscape: $maxLinesPortrait, // You may provide a different line limit for landscape orientation. | |
// Note that 'portrait' is our default orientation. However, if you omit $maxLinesLandscape, | |
// the value of $maxLinesPortrait is used for whatever orientation (that is, without a media query). |
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
<html> | |
<head> | |
<script src="https://apis.google.com/js/client.js"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> | |
<script> | |
function auth() { | |
var config = { | |
'client_id': 'OAUTH_CLIENT_ID', | |
'scope': 'https://www.google.com/m8/feeds' | |
}; |
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
/* | |
Chrome Packaged app Bluetooth API test | |
Before interacting with a BT device, you need to : | |
1) get the device MAC and service UUID with startDiscovery and getServices methods | |
2) request permission with chrome.permissions.request | |
3) add the service profile with chrome.bluetooth.addProfile (a profile is only {uuid:'xxxxxxx...'}) | |
*/ | |
// onConnection callback | |
chrome.bluetooth.onConnection.addListener( |
OlderNewer