Skip to content

Instantly share code, notes, and snippets.

View dskarataev's full-sized avatar

Denis Karataev dskarataev

  • Ho Chi Minh City, Vietnam
View GitHub Profile
@dskarataev
dskarataev / httpclient.go
Created July 1, 2020 10:45 — forked from vearutop/httpclient.go
Go OAuth2 password-based http transport middleware
// Package oauth2 implements password-based authentication middleware.
package oauth2
import (
"context"
"fmt"
"net/http"
"time"
"golang.org/x/oauth2"
@dskarataev
dskarataev / odoo_requirements_pypy.txt
Created May 20, 2016 12:28 — forked from vuamitom/odoo_requirements_pypy.txt
Odoo 8 pip requirements.txt for Pypy
Babel==1.3
Jinja2==2.7.3
Mako==1.0.0
MarkupSafe==0.23
Pillow==2.5.1
http://download.gna.org/pychart/PyChart-1.39.tar.gz#egg=PyChart
PyYAML==3.11
Werkzeug==0.9.6
argparse==1.2.1
decorator==3.4.0
@dskarataev
dskarataev / average_int_from_files.py
Last active May 19, 2016 16:45
Getting average value of recursively read integers from files
import re
def get_numbers(filename):
numbers = []
try:
f = open(filename, 'r')
except IOError:
return numbers
<?php
/**
* Script to send an email using Experian UMS with attachments
*/
$url = 'http://sysmail.fagms.net/c/tm?ACTION=SYSTEM';
$file = 'test.png';
$aid = 000000; // Replace with your ID
$email = '...'; // Replace with your email
file_put_contents($file, base64_decode(test_png()));
@dskarataev
dskarataev / files_management.py
Created January 12, 2015 14:37
files management
#coding: utf-8
import os
from openerp import SUPERUSER_ID
from openerp.osv import osv, fields
from openerp.tools.translate import _
import re
def utf8(value):
if isinstance(value, (str, unicode, basestring)):
@dskarataev
dskarataev / json_response.py
Created January 8, 2015 22:02
Good JSON response for Django
# Copyright 2012 Twitter
#
# 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,
@dskarataev
dskarataev / json_decorator.py
Created January 8, 2015 22:01
Good JSON decorator for Django
from django.db import models
from django.utils.functional import Promise
from django.utils.encoding import force_unicode
from django.utils import simplejson as json
from decimal import Decimal
from django.core import serializers
from django.conf import settings
from django.http import HttpResponse, HttpResponseForbidden, Http404
from django.core.mail import mail_admins
from django.db.models.query import QuerySet
@dskarataev
dskarataev / logstat.py
Last active August 29, 2015 14:12
logstat.py
#!/usr/bin/env python
# coding: utf-8
# Implementation of screening test for position Backend Developer
# 2014, Denis Karataev
import re
import numpy
LOG_PATH = '/home/dsk/sample.log'
TEMPLATES = [
'GET /api/users/{user_id}/count_pending_messages',
@dskarataev
dskarataev / requirements.txt
Last active August 29, 2015 14:04
requirements.txt for odoo v8 (from https://github.com/odoo/odoo/pull/799)
Babel==1.3
Jinja2==2.7.3
Mako==1.0.0
MarkupSafe==0.23
Pillow==2.4.0
http://download.gna.org/pychart/PyChart-1.39.tar.gz
PyWebDAV==0.9.8
PyYAML==3.11
Werkzeug==0.9.6
argparse==1.2.1

I just had to set up Jenkins to use GitHub. My notes (to myself, mostly):

Detailed Instructions

For setting up Jenkins to build GitHub projects. This assumes some ability to manage Jenkins, use the command line, set up a utility LDAP account, etc. Please share or improve this Gist as needed.

Install Jenkins Plugins