Skip to content

Instantly share code, notes, and snippets.

View jpospychala's full-sized avatar

Jacek Pospychala jpospychala

View GitHub Profile
<!DOCTYPE html><html><head><meta charset="utf-8"><title>Valuto API</title><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"><style>@import url('https://fonts.googleapis.com/css?family=Roboto:400,700|Inconsolata|Raleway:200');.hljs-comment,.hljs-title{color:#8e908c}.hljs-variable,.hljs-attribute,.hljs-tag,.hljs-regexp,.ruby .hljs-constant,.xml .hljs-tag .hljs-title,.xml .hljs-pi,.xml .hljs-doctype,.html .hljs-doctype,.css .hljs-id,.css .hljs-class,.css .hljs-pseudo{color:#c82829}.hljs-number,.hljs-preprocessor,.hljs-pragma,.hljs-built_in,.hljs-literal,.hljs-params,.hljs-constant{color:#f5871f}.ruby .hljs-class .hljs-title,.css .hljs-rules .hljs-attribute{color:#eab700}.hljs-string,.hljs-value,.hljs-inheritance,.hljs-header,.ruby .hljs-symbol,.xml .hljs-cdata{color:#718c00}.css .hljs-hexcolor{color:#3e999f}.hljs-function,.python .hljs-decorator,.python .hljs-title,.ruby .hljs-function .hljs-title,.ruby .hljs-title .hljs-keyword,.perl .hljs-sub,.javascript
@jpospychala
jpospychala / gist:69d783f2eeeea1a9450e
Last active December 21, 2021 16:44
create DigitalOcean droplet from shell with curl and rcli
# this script expects $DOTOKEN variable with your digital ocean token
# this script gets or creates smallest DO droplet and remotely executes script on it
# afterwards, droplet is destroyed
DROPLETNAME=example.com
DOHOME="https://api.digitalocean.com/v2"
cat <<EOF > .curlargs
-s
-H "Authorization: Bearer $DOTOKEN"
{"description": "JKE Banking (Change Management)",
"name": "JKE Banking (Change Management)",
"uuid": "_zcQAsgqbEeOoOJObZSBBwg",
"children" : [
{"description": "",
"name": "Main Development",
"label": "Main Development",
"uuid": "_zcQAsgqbEeOoOJObZSBBwg",
"children" : [
{"description": "",
@jpospychala
jpospychala / elt.patch
Created December 7, 2012 13:36
eltpatch
### Eclipse Workspace Patch 1.0
#P com.google.eclipse.elt.pty
diff --git utils/com/google/eclipse/elt/pty/util/Processes.java utils/com/google/eclipse/elt/pty/util/Processes.java
index 70cc4c3..16b1e29 100644
--- utils/com/google/eclipse/elt/pty/util/Processes.java
+++ utils/com/google/eclipse/elt/pty/util/Processes.java
@@ -1,14 +1,15 @@
package com.google.eclipse.elt.pty.util;
-import org.eclipse.cdt.utils.pty.PTY;
@jpospychala
jpospychala / MainApp.java
Created December 7, 2012 09:54
java terminal for windows
package testswt;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
@jpospychala
jpospychala / robot.js
Created December 6, 2012 10:56 — forked from randompast/robot.js
my2
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
robot.clone()
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
if(robot.parentId) {
robot.turn(1);
@jpospychala
jpospychala / robot.js
Created December 6, 2012 09:29
myrobot
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
this.sgn = 1;
this.count = 0;
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
@jpospychala
jpospychala / DetectNoResponse.java
Created November 6, 2012 13:27
Detects when SWT app is in Not responding state
import java.util.Iterator;
import java.util.Map;
import org.eclipse.swt.widgets.Display;
public class DetectNoResponse {
// timeout (msec) minimal time of no response to detect
protected long timeout = 1000;
protected long displayThreadResponse;