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
""" | |
Setup for Ghostscript: | |
Download it from http://www.ghostscript.com/ and | |
add `/path/to/gs9.07/bin/` and `/path/to/gs9.07/lib/` to your path. | |
""" | |
import os | |
import subprocess | |
import tkinter as tk |
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
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd" | |
version="2.1"> | |
<!-- Hibernate + H2 --> | |
<persistence-unit name="standalonePu" transaction-type="RESOURCE_LOCAL"> | |
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> | |
<class>com.acme.MyEntity</class> | |
<properties> |
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
#!/usr/bin/env python | |
import sys | |
import os | |
import ftplib | |
import socket | |
import getpass | |
try: | |
input = raw_input |
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 asyncio | |
import tkinter as tk | |
# Concepts | |
# https://www.tcl.tk/man/tcl8.7/TkLib/MainLoop.html | |
# https://www.tcl.tk/man/tcl8.7/TclLib/DoOneEvent.html | |
# https://www.tcl.tk/man/tcl8.7/TclCmd/update.html | |
# https://www.tcl.tk/man/tcl8.7/TclCmd/after.html | |
# SO related questions |
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 sys | |
import time | |
import socket | |
import asyncio | |
DEFAULT_IP = '127.0.0.1' # local host, just for testing | |
DEFAULT_PORT = 43278 # an arbitrary UDP port | |
BEATWAIT = 1 # number of seconds between heartbeats | |
async def main(): |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Event delegation example (with jQuery)</title> | |
<style> | |
button { margin: 5px; } | |
</style> | |
</head> | |
<body> |
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 Tkinter import * | |
import urllib2 | |
HTTP_METHODS = ["GET", "POST", "PUT", "REMOVE"] | |
class HttpGuiApplication(Tk): | |
def __init__(self): | |
Tk.__init__(self) |
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
class Singleton(object): | |
""" | |
Decorator for the singletton pattern in Python: http://stackoverflow.com/q/31875 | |
Usage:: | |
>>> @Singleton | |
class MyClassSingleton(object): pass | |
>>> instance = MyClassSingleton.instance |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Hello, ES6</title> | |
<script src="counter.js"></script> | |
</head> | |
<body> | |
<my-counter></my-counter> | |
</body> | |
</html> |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Flex navigation menu</title> | |
<style> | |
body { | |
font-family: sans-serif; | |
margin: 0; | |
} |
NewerOlder