Skip to content

Instantly share code, notes, and snippets.

View lidavidm's full-sized avatar

David Li lidavidm

View GitHub Profile
Traceback (most recent call last):
File "C:\Documents and Settings\tester\Miniconda3\Scripts\ipython-script.py", line 9, in <module>
start_ipython()
File "C:\Documents and Settings\tester\Miniconda3\lib\site-packages\IPython\__init__.py", line 120, in start_ipython
return launch_new_instance(argv=argv, **kwargs)
File "C:\Documents and Settings\tester\Miniconda3\lib\site-packages\IPython\config\application.py", line 563, in launch_instance
app.initialize(argv)
File "<string>", line 2, in initialize
File "C:\Documents and Settings\tester\Miniconda3\lib\site-packages\IPython\config\application.py", line 92, in catch_config_error
return method(app, *args, **kwargs)
@lidavidm
lidavidm / designer.html
Created September 11, 2014 01:37
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
@lidavidm
lidavidm / gist:9928de726c0aed8a36a8
Last active August 29, 2015 14:15
CEE1130: dml339 Assignment 2
{
"metadata": {
"name": "",
"signature": "sha256:b081ae105846bb3cc979fcc46b848d206e3e2f15b94aa3ae1faf86a1d8ff7480"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
>>> import functools
>>> def thingy(a, b):
... return "{} {}".format(a, b)
...
>>> data = [0, 1, 2, 3, 4]
>>> a, *b = data
>>> a
0
>>> b
[1, 2, 3, 4]
//! # Basic Sample
//!
//! This sample demonstrates how to create a toplevel `window`, set its title, size and position, how to add a `button` to this `window` and how to connect signals with actions.
#![crate_type = "bin"]
extern crate gtk;
use gtk::signal::StatusIconSignals;
use gtk::traits::*;

Keybase proof

I hereby claim:

  • I am lidavidm on github.
  • I am lidavidm (https://keybase.io/lidavidm) on keybase.
  • I have a public key whose fingerprint is A1F5 3594 0234 AEBA A56A 3243 A751 53D3 42B7 6FF1

To claim this, I am signing this object:

@lidavidm
lidavidm / generated.js
Created April 1, 2016 23:48
Generated Skulpt code
var $scope0 = (function($modname) {
var $gbl = {},
$blk = 0,
$exc = [],
$loc = $gbl,
$err = undefined;
$gbl.__name__ = $modname, $ret = undefined, currLineNo = undefined, currColNo = undefined;
if (typeof Sk.execStart === 'undefined') {
Sk.execStart = Date.now()
}
@lidavidm
lidavidm / botproxy.py
Created December 29, 2017 21:46
Halite II remote debugging
import socket
import sys
# Connect
socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket.bind(('localhost', int(sys.argv[1])))
socket.listen(1)
connection, _ = socket.accept()
# IO Functions