Skip to content

Instantly share code, notes, and snippets.

@Eagllus
Eagllus / locustfile.py
Created September 29, 2017 11:22
Performance test Django
"""
On my machine (I use fish terminal)
set DJANGO_SETTINGS_MODULE lux.settings.dev | gunicorn cc.wsgi:application --name cc --workers 6 --bind=unix:/var/tmp/gunicorn.sock --log-level=info -b 127.0.0.1:8000
and start locust by
locust -f locustfile.py --host=http://localhost:8080/
"""
from locust import HttpLocust, TaskSet, task
@Eagllus
Eagllus / test example
Created April 16, 2015 08:46
Examples
test 'create with labels' do
post(:create, csr: { common_name: 'foo', csr: @csr, labels: ['a', 'b', 'c'] })
assert_response :created
assert_equal '/api/certs/foo', @response.location
end
@Eagllus
Eagllus / Capture all errors
Last active August 29, 2015 14:06
Python useful stuff
except:
import sys
print(sys.exc_info()[0])
@Eagllus
Eagllus / keybase.md
Last active August 29, 2015 13:57
Keybase proof

Keybase proof

I hereby claim:

  • I am eagllus on github.
  • I am ronaldvanzon (https://keybase.io/ronaldvanzon) on keybase.
  • I have a public key whose fingerprint is 13F6 EB08 4A02 9BC5 D35A 5911 7996 E531 8519 C9A3

To claim this, I am signing this object:

@Eagllus
Eagllus / Checkbox selected
Last active January 3, 2016 04:08
Select all checkboxes
var allInputs = document.getElementsByTagName("input");
for (var i = 0, max = allInputs.length; i < max; i++){
if (allInputs[i].type === 'checkbox')
allInputs[i].checked = true;
}