Skip to content

Instantly share code, notes, and snippets.

View pombredanne's full-sized avatar

Philippe Ombredanne pombredanne

View GitHub Profile
@pombredanne
pombredanne / Programming_Languages_Extensions.json
Created November 3, 2022 12:18 — forked from ppisarczyk/Programming_Languages_Extensions.json
Programming Languages and their File Extensions
[
{
"name":"ABAP",
"type":"programming",
"extensions":[
".abap"
]
},
{
"name":"AGS Script",
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
@pombredanne
pombredanne / group.py
Created September 22, 2022 10:13
Grouping tokens
def group_tokens(tokens):
"""
Return lists of token group lists where all tokens in a group have the same
characteristics. This is a list of lists.
For example::
>>> tok1 = Token(value="tok1", line_num=1, match_ids=[0])
>>> tok2 = Token(value="tok2", line_num=1, match_ids=[1])
>>> tok3 = Token(value="tok3", line_num=1, match_ids=[3])
@pombredanne
pombredanne / c_sharp_for_python.md
Last active July 23, 2022 13:22 — forked from mrkline/c_sharp_for_python.md
An intro to C# for a Python developer. Made for one of my coworkers.

C# For Python Programmers

Syntax and core concepts

Basic Syntax

  • Single-line comments are started with //. Multi-line comments are started with /* and ended with */.

  • C# uses braces ({ and }) instead of indentation to organize code into blocks. If a block is a single line, the braces can be omitted. For example,

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
import requests
import re
import sys
from multiprocessing.dummy import Pool
def robots(host):
r = requests.get(
'https://web.archive.org/cdx/search/cdx\
?url=%s/robots.txt&output=json&fl=timestamp,original&filter=statuscode:200&collapse=digest' % host)
import requests
import sys
import json
def waybackurls(host, with_subs):
if with_subs:
url = 'http://web.archive.org/cdx/search/cdx?url=*.%s/*&output=json&fl=original&collapse=urlkey' % host
else:
url = 'http://web.archive.org/cdx/search/cdx?url=%s/*&output=json&fl=original&collapse=urlkey' % host
import json
file = 'evaluated-model-things.json'
# list all license references here that frequently cause false positives
scanRefLicencesList = [
'LicenseRef-scancode-unknown-license-reference',
'LicenseRef-scancode-free-unknown',
'LicenseRef-scancode-proprietary-license',
'LicenseRef-scancode-generic-export-compliance',
'LicenseRef-scancode-generic-cla',
@pombredanne
pombredanne / fastio.py
Created February 5, 2022 14:17 — forked from satra/fastio.py
Multithreaded Python os.walk
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,