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>Flex navigation menu</title> | |
<style> | |
body { | |
font-family: sans-serif; | |
margin: 0; | |
} |
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
<!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
import os | |
import shutil | |
import filecmp | |
from itertools import combinations | |
DIR = 'C:/Alotofwildphotos' | |
DEST_DIR = 'C:/Alotofwildphotos/Repeated' | |
files = filter(os.path.isfile, map(lambda f: os.path.join(DIR, f), os.listdir(DIR))) |
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
(function ($) { | |
// Create a model to hold friend atribute | |
Friend = Backbone.Model.extend({ | |
name: null | |
}); | |
// This is our Friends collection and holds our Friend models | |
Friends = Backbone.Collection.extend({ | |
initialize: function (models, options) { | |
// Listen for new additions to the collection and call a view function if so |
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> | |
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script> | |
<style> | |
.treeview ul { | |
padding-left: 24px; | |
list-style-type: none; | |
} | |
.treeview li > div { |
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
public class HelloWorld extends Application { | |
private Calculator calculatorService; | |
public static void main(String[] args) { | |
launch(args); | |
} | |
@Override | |
public void start(Stage primaryStage) throws MalformedURLException { |
NewerOlder