Skip to content

Instantly share code, notes, and snippets.

View andrask's full-sized avatar

Andras Kovi andrask

  • Budapest, Hungary
View GitHub Profile
@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
@hwellmann
hwellmann / pom-snippet.xml
Last active April 17, 2018 05:43
Integrating EMF code generation from an Ecore model into a Tycho build. Sources: my.ecore, my.genmodel, plugin.xml, META-INF/MANIFEST.MF. build.properties Generated Java sources end up in target/generated-sources/emf/src. This directory is included in build.properties as an additional source folder.
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-eclipserun-plugin</artifactId>
<!-- tested with 0.18 -->
<version>${tycho.version}</version>
<configuration>
<!-- linebreaks not permitted in this arg line -->
<appArgLine>-data target/workspace -application org.eclipse.emf.codegen.ecore.Generator -projects ${basedir} -model ${basedir}/model/my.genmodel target/generated-sources/emf</appArgLine>
<dependencies>
<dependency>
@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".
@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
@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')
@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') }}"
@elentok
elentok / script_dir.sh
Created May 9, 2013 11:33
Current script directory (works in bash and zsh)
SCRIPT_DIR=`dirname ${BASH_SOURCE[0]-$0}`
SCRIPT_DIR=`cd $SCRIPT_DIR && pwd`
@adsr303
adsr303 / gimp-whiteboard.md
Last active September 29, 2023 14:56
Clean-up a whiteboard photo with GIMP

How to clean up a whiteboard photo using GIMP

Skipping other possible actions, such as perspective corrections, here is how:

  1. Duplicate the base image layer.
  2. Set the new layer's mode to "Divide".
  3. Apply a Gaussian blur with a radius of about 50 (Filters/Blur/Gaussian Blur...).

If you need to manipulate the resulting image further, create a new layer from visible (Layer/New from Visible).

/**
Provides the ability to verify key paths at compile time.
If "keyPath" does not exist, a compile-time error will be generated.
Example:
// Verifies "isFinished" exists on "operation".
NSString *key = SQKeyPath(operation, isFinished);
// Verifies "isFinished" exists on self.
@tinkertims
tinkertims / install_byobu_on_centos7.sh
Last active February 26, 2024 05:44
Install byobu to CentOS 7
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
rpm -ivh epel-release-7-5.noarch.rpm
sudo yum install byobu -y --enablerepo=epel-testing