Skip to content

Instantly share code, notes, and snippets.

View andrask's full-sized avatar

Andras Kovi andrask

  • Budapest, Hungary
View GitHub Profile
@wtcross
wtcross / provision-instance.yml
Created June 14, 2016 15:01
Example of an Ansible playbook that interacts with OpenStack. It is runnable via Ansible and Ansible Tower.
```yaml
- name: Provision a compute instance
hosts: localhost
gather_facts: no
become: no
vars:
os_config_file: "{{ lookup('env', 'OS_CLIENT_CONFIG_FILE') }}"
os_auth:
project_name: "{{ lookup('env', 'OS_PROJECT') }}"
auth_url: "{{ lookup('env', 'OS_AUTH_URL') }}"
@renyi
renyi / gist:1558477
Created January 4, 2012 04:23
python urlencode/urldecode
import urllib2
def urlencode(s):
return urllib2.quote(s)
def urldecode(s):
return urllib2.unquote(s).decode('utf8')
@makinde
makinde / arc_setup.sh
Created February 3, 2012 21:46
Arc Setup (Ubuntu)
#!/bin/bash
if ! hash git &> /dev/null || ! hash php &> /dev/null; then
echo -e " *****\n ***** INSTALLING GIT AND PHP\n *****"
if hash apt-get &> /dev/null; then
sudo apt-get install git-core php5-cli php5-curl
elif hash port &> /dev/null; then
sudo port install php5-curl
elif hash fink &> /dev/null; then
@pokk
pokk / README.md
Last active July 23, 2018 06:59
Redirect file stdin in PyCharm

Introduction

For Pycharm IDE, we want to use redirect input file while running the code.

How to Use

  1. You can make a file for a input data as like *.in.
  2. Typing auto_redirect_input_file.py in top of code.
  3. Click the "Edit Configuration".
  4. Put the file name *.in in "Script parameters".
@ekantola
ekantola / RxJS-intro.js
Last active June 1, 2017 11:19
RxJS intro snippets
/*
* Observable
*/
var xs = Rx.Observable.range(0, 3)
xs.subscribe(log)
//=> 0
//=> 1
//=> 2