Skip to content

Instantly share code, notes, and snippets.

@skarab7
skarab7 / api_acceptance_test.py
Last active June 18, 2017 13:16
api_acceptance_test.py
import requests
import jmespath
def main():
"""
"""
try:
r = requests.get("https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22nome%2C%20ak%22)&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys")
except requests.exceptions.RequestException as e:
@skarab7
skarab7 / .gitignore
Created June 17, 2017 08:56
gitignore dla teaching-jenkins
jenkins/.**
jenkins/war/**
jenkins/plugins/**
jenkins/copy_reference_file.log
jenkins/logs/**
jenkins/queue.xml.bak
jenkins/jobs/*/builds
jenkins/jobs/*/workspace
jenkins/credentials.xml
jenkins/plugins.txt
@skarab7
skarab7 / add_or_update_creds.groovy.groovy
Created June 17, 2017 08:30
add_or_update_creds.groovy.groovy
/*
# add credentials for cloning git repository over https
export ADMIN_USER=admin
export ADMIN_PASSWORD=
java -jar ./war/WEB-INF/jenkins-cli.jar -s http://127.0.0.1:8080/ groovy \
--username $ADMIN_USER --password $ADMIN_PASSWORD \
tools/add_or_update_creds.groovy \
github-helloworld-username \
github-helloworld-password \
@skarab7
skarab7 / create_user.groovy
Last active June 17, 2017 09:22
create_user.groovy
/*
Umieść w swoim repozytorim teaching-jenkins:
jenkins/tools/create_user.groovy
*/
/*
# create a user
docker exec -i -t jenkins-wsb /bin/bash
cd /var/jenkins_home
@skarab7
skarab7 / gist:59d0d8da058479e88d02fac351f2bc31
Created March 24, 2017 21:46
Instalacja virtualenvwrapper dla CentOS
Co trzeba:
# http://virtualenvwrapper.readthedocs.io/en/latest/install.html
yum install python-pip
pip install virtualenv
pip install virtualenvwrapper
# najlepiej dodać do .bashrc lub .profile
export WORKON_HOME=~/.virtualenvs
#cloud-config
package_upgrade: true
packages:
- python-dev
- python-pip
- vim-tiny
- tmux
- libffi-dev # for pyopenssl
- libssl-dev # for pyopenssl
- python-virtualenv
@skarab7
skarab7 / n_i_a_projects.rst
Last active March 3, 2016 11:11
Dla N i A.
@skarab7
skarab7 / list_of_js_css_based_presentation_tools.rst
Last active April 11, 2016 09:29
js_css_based_presentations_frameowrks

JS/CSS frameworks

I use:

  • deckjs - Toyota :) with phantomjs easy to generate pdf [my first choice]
  • Reveal.js - nice, elegant, the layout is not so classic as in deckjs, Basement levels! - demo [elegant]

Next to check:

def porownaj_implementacje_sortowania(n)
a = []
generuj_tablice_N_elementow(a, n)
czas_babelkowego = get_czas_sortowania_babelkowego(a)
czas_quicksort = get_czas_sortowania_quicksort(a)
puts "Numer elementów #{n}, bubble: #{czas_babelkowego}, qs: #{czas_quicksort}"
end
def generuj_tablice_N_elementow(tablica, ilosc_elementow)
(1..ilosc_elementow).each do |i|