Skip to content

Instantly share code, notes, and snippets.

View stevepeak's full-sized avatar

Steve Peak stevepeak

View GitHub Profile
@stevepeak
stevepeak / main.js
Created September 10, 2015 20:17
How to check window before pageMod runs
var _meta = worker.window.document.querySelector('meta[property="og:site_name"]');
if (worker.window.location.hostname === "bitbucket.org" || (_meta && _meta.attributes.content.value === 'GitHub')) {
var data = require('sdk/self').data,
pageMod = require('sdk/page-mod'),
prefs = require('sdk/simple-prefs').prefs;
pageMod.PageMod({
include: '*',
contentScriptFile : [data.url('jquery-2.1.3.min.js'),
data.url('codecov.js')
@stevepeak
stevepeak / output.md
Last active September 23, 2015 08:13

This extract is from an SSH from [this build][1] on a Java machine.

Below is how the path I'm hoping Circle will add. As demonstraged below when install a python package that has a cli it is not availalbe without appending its location.

# install codecov
ubuntu@box123:~$ pip install --user codecov
# it was already installed in my circle.yml build step
Requirement already satisfied (use --upgrade to upgrade): codecov in ./.local/lib/python2.7/site-packages
codecov:
token: uuid # Your private repository token
url: "http" # for Codecov Enterprise customers
slug: "owner/repo" # for Codecov Enterprise customers
branch: master # override the default branch
bot: username # set user whom will be the consumer of oauth requests
ci: # Custom CI domains if Codecov does not identify them automatically
- ci.domain.com
- !provider # ignore these providers when checking if CI passed
# ex. You may test on Travis, Circle, and AppVeyor, but only need
@stevepeak
stevepeak / Rakefile
Created February 23, 2016 17:45 — forked from stephanvd/Rakefile
CodeCov setup for parallel_test gem
namespace :codecov do
desc 'Uploads the latest simplecov result set to codecov.io'
task upload: :environment do
require 'simplecov'
require 'codecov'
formatter = SimpleCov::Formatter::Codecov.new
formatter.format(SimpleCov::ResultMerger.merged_result)
end
end
@stevepeak
stevepeak / delete.py
Created April 19, 2016 12:23
AWS delete obj
import hmac
import requests
from hashlib import sha1
from datetime import datetime
from base64 import b64encode
AKI = ''
AKS = ''
bucket = ''
path = ''
# all the values below are set by default to all project.
# you can essentially skip these settings in your custom file.
codecov:
notify:
require_ci_to_pass: yes
coverage:
precision: 2
round: down
range: "70...100"
$ curl -i https://circleci.com/api/v1/project/heroku/heroku-oauth/33
HTTP/1.1 404 Not Found
Access-Control-Allow-Origin: *
Content-Type: text/plain; charset=utf-8
Date: Thu, 09 Jun 2016 11:04:59 GMT
Server: nginx
Set-Cookie: ring-session=bhjAOUGcHJZGvZWri1ugahqx5QK1xLKtoRxTlUT%2BFyuzFd0IATOJd0hfwO1HYp9nmKcpqgHC%2Bo2EBOObMdkaf77X0BsJvl5GnSPME9noaH2nZJOrwbUjK6RUBaIIrhmLHkccfMJt8yOtYPpBmW5AK8GtAqMO7MmcvwXNSVSmH3wHKMXKTwD9PR5yOOJ24EVgtZeBeP65sJkqOiVLGtYimR8EQLCC7AWhIdjnFK3KRE4%3D--gHODrGvSgc5VrppRdeFikkqPH4AS3gao80sdpbLQDQg%3D;Path=/;HttpOnly;Expires=Thu, 08 Jun 2017 23:00:23 +0000;Max-Age=31536000;Secure
Set-Cookie: ab_test_user_seed=0.2719694976718555;Expires=Fri, 09 Jun 2017 11:04:59 +0000;Path=/;Secure
X-Circleci-Identity: i-ea00d470
import jwt
import requests
from time import time
pem_file = '/path/to/github.pem' # the absolute path to your Application Pem Certificate issued by GitHub
integration_id = 0 # GitHub Application Integration ID
installation_id = 0 # once installed on an organization. The Organization Integration ID
expire_seconds = 500 # number of seconds the jwt token expires (max ~600 but not designated by GitHub)
slug = 'owner/repo' # name of repo for demo purposes
def run_coroutine_sync(func):
def wrapped(*args, **kwargs):
if kwargs.pop('_in_loop', False):
# used for thread-local state
# only call run_sync on first api call, subsiquent calls are already "in the loop"
return func(*args, **kwargs)
else:
@gen.coroutine
def inner():
res = yield func(*args, **kwargs)