Skip to content

Instantly share code, notes, and snippets.

Individual Contributor License Agreement ("Agreement"), v1.0
Thank you for your interest in contributing to open-source software projects (“Projects”) made available by cljazz, Inc., or its affiliates (cljazz). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to cljazz in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact hey@cljazz.co.
You accept and agree to the following terms and conditions for Your past, present, and future Contributions submitted to cljazz, Inc. ("cljazz"). Except for the license granted herein to cljazz and recipients of software distributed by cljazz, You reserve all right, title, and interest in and to Your Contributions.
Definitio
@avelino
avelino / JGitUtil.java
Created December 20, 2019 01:24 — forked from porcelli/JGitUtil.java
jgit on bare repo
public static void delete(final Git git, final String branchName, final String path,
final String name, final String email, final String message, final TimeZone timeZone, final Date when) {
commit(git, branchName, path, null, name, email, message, timeZone, when);
}
public static void commit(final Git git, final String branchName, final String path, final File file,
final String name, final String email, final String message, final TimeZone timeZone, final Date when) {
final String gitPath = fixPath(path);
from datetime import datetime
github_date = datetime.strptime(input_data['github_date_str'], '%Y-%m-%dT%H:%M:%SZ')
weeknumber = int(github_date.strftime("%w"))
task_date = 'tuesday'
if weeknumber >= 4 and weeknumber <= 5:
task_date = 'thursday'
return {'task_date': task_date}
info: Hooks handler stderr: Traceback (most recent call last):
File "/Users/avelino/.virtualenvs/dredd/bin/dredd-hooks-python", line 13, in <module>
info: Hooks handler stderr: dredd.main(sys.argv[1:])
File "/Users/avelino/.virtualenvs/dredd/lib/python2.7/site-packages/dredd_hooks/dredd.py", line 246, in main
load_hook_files(a)
File "/Users/avelino/.virtualenvs/dredd/lib/python2.7/site-packages/dredd_hooks/dredd.py", line 142, in load_hook_files
info: Hooks handler stderr: module = imp.load_source(os.path.basename(path), real_path)
File "/Users/avelino/src/github.com/nuveo/publicapi/hooks.py", line 60
#!/usr/bin/env python
import requests
import base64
proxies = {
'http': 'http://avelino:PASS@us-wa.proxymesh.com:31280',
'https': 'http://avelino:PASS@us-wa.proxymesh.com:31280'
}
λ ~/test/ tree
.
├── adapters
│   ├── adapters.go
│   ├── mongodb
│   │   └── mongodb.go
│   └── postgres
│   └── postgres.go
├── helpers
│   └── herlpers.go
package main
import "fmt"
func fact(n int) int {
if n == 0 {
return 1
}
return n * fact(n-1)
}
#include <stdio.h>
int fac(int);
int fac(int n) {
if (n == 0) {
return 1;
}
return n * fac(n - 1);
}
#!/usr/bin/env python
# https://avelino.xxx/golang-c-and-python-the-benchmark-time/
def fac(n):
if n == 0:
return 1
return n * fac(n - 1)
if __name__ == "__main__":
t = 0
# https://avelino.xxx/go-vs-python-more-request-per-second/
import falcon
class ThingsResource:
def on_get(self, req, resp):
resp.status = falcon.HTTP_200
resp.body = ("Hello World")
app = falcon.API()