Skip to content

Instantly share code, notes, and snippets.

import time
import os
from cypher import identify
from dev import LANG_INFO
supported = [s.lower() for s in LANG_INFO.keys()]
data = '' # path to benchmark data (https://github.com/nbraud/benchmarksgame/tree/master/bench)
name2ext = {
'csharp': 'C#', 'gcc': 'C', 'gpp': 'C++', 'ghc': 'Haskell',
#Copyright (c) 2011 David Klein and Simon Weber
#Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
import sys
from identifytraits import *
import commentIdentify
#gets a list of all the languages known so far
def getLanguages():
import time
import subprocess
import os
supported = [
'haskell', 'python', 'ruby', 'java', 'c#', 'c++', 'javascript', 'scala',
'pascal', 'go', 'c', 'php', 'perl', 'matlab', 'clojure', 'visual basic'
]
folder = '' # path to benchmark data (https://github.com/nbraud/benchmarksgame/tree/master/bench)
name2ext = {
var walk = require('walk')
var fs = require('fs')
var detectLang = require('lang-detector')
var supported = [
'javascript', 'c', 'c++', 'python', 'java', 'html', 'css', 'ruby', 'go', 'php'
]
var ext2Lang = {
'csharp': 'C#', 'gcc': 'C', 'gpp': 'C++', 'ghc': 'Haskell', 'jruby': 'Ruby',
'python3': 'Python', 'hack': 'PHP', 'yarv': 'Ruby', 'C-sharp': 'C#'
}
@jdkato
jdkato / pypi-release-checklist.md
Created November 16, 2016 13:59 — forked from audreyfeldroy/pypi-release-checklist.md
My PyPI Release Checklist
  • Update HISTORY.rst
  • Commit the changes:
git add HISTORY.rst
git commit -m "Changelog for upcoming release 0.1.1."
  • Update version number (can also be minor or major)
bumpversion patch
import datetime
tdt = datetime.datetime.strptime('2:30.00', '%M:%S.%f')
total = 60 * tdt.minute + (tdt.second + (tdt.microsecond / 1000000.0))
done = False
count = 0
times = []
splits = []
while not done:
split = input('split: ')
import datetime
done = False
count = 0
times = []
splits = []
while not done:
split = input('split: ')
if split == '':
done = True
This is intended as a quick reference and showcase. For more complete info, see [John Gruber's original spec](http://daringfireball.net/projects/markdown/) and the [Github-flavored Markdown info page](http://github.github.com/github-flavored-markdown/).
^ Paragraph start
^ Block end
^ Linting paragraph
This cheatsheet is specifically *Markdown Here's* version of Github-flavored Markdown. This differs slightly in styling and syntax from what Github uses, so what you see below might vary a little from what you get in a *Markdown Here* email, but it should be pretty close.
^ Paragraph start
^ Block end
^ Linting paragraph

Keybase proof

I hereby claim:

  • I am jdkato on github.
  • I am jdkato (https://keybase.io/jdkato) on keybase.
  • I have a public key whose fingerprint is E374 305F 11CF 8879 591C 8083 72B6 1C8B C681 C52E

To claim this, I am signing this object:

@jdkato
jdkato / recover_source_code.md
Created May 28, 2017 16:40 — forked from simonw/recover_source_code.md
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb