Skip to content

Instantly share code, notes, and snippets.

View bduisenov's full-sized avatar

Babur bduisenov

  • Munich
View GitHub Profile
@bduisenov
bduisenov / package.json
Created February 21, 2018 15:46
parceljs
{
"scripts": {
"start": "parcel src/assets/index.html",
"build": "NODE_ENV=production parcel build src/ts/index.ts --no-cache"
},
"devDependencies": {
"@types/clipboard": "^1.5.36",
"@types/codemirror": "0.0.38",
"@types/mithril": "^1.1.12",
"@types/quill": "0.0.29",
@bduisenov
bduisenov / docker-compose.yml
Created January 29, 2018 08:32
Run in docker with memlimit
version: "2.1"
services:
inspector:
image: swift:4.0.2
working_dir: /app
command: .build/debug/Run
ports:
- "8080:8080"
#!/bin/bash
anybarNotify () {
(echo -n "$1" | nc -u -c -w 1 localhost 1738) &
}
if pgrep AnyBar > /dev/null; then
echo "skip starting anybar"
else
echo "starting anybar"
import Foundation
private func bash(_ commandName: String, _ arguments: [String]) -> String? {
guard var whichPathForCommand = executeShell(command: "/bin/bash" , arguments:[ "-l", "-c", "which \(commandName)" ]) else {
return "\(commandName) not found"
}
whichPathForCommand = whichPathForCommand.trimmingCharacters(in: NSCharacterSet.whitespacesAndNewlines)
return executeShell(command: whichPathForCommand, arguments: arguments)
}
class Reader<E, A> {
let g: (E) -> A
init(g: @escaping (E) -> A) {
self.g = g
}
func apply(e: E) -> A {
return g(e)
}
func map<B>(f: @escaping (A) -> B) -> Reader<E, B> {
return Reader<E, B>{ e in f(self.g(e)) }
{
"id": "https://tools.ietf.org/rfc/rfc7807.txt",
"$schema": "http://json-schema.org/draft-06/schema#",
"description": "schema for a rfc7807",
"definitions": {
"validation": {
"type": "object",
"required": [
"type"
],
import * as m from 'mithril';
import Page from "../page/page";
import * as Stomp from 'stompjs';
import * as SockJS from 'sockjs-client';
var vm = {
value: m.prop('')
};
const StatisticsPage = {
@bduisenov
bduisenov / Vue.java
Last active March 18, 2016 11:55
gwt jsinterop mapping to vue.js
import jsinterop.annotations.JsConstructor;
import jsinterop.annotations.JsFunction;
import jsinterop.annotations.JsIgnore;
import jsinterop.annotations.JsMethod;
import jsinterop.annotations.JsOverlay;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
import com.google.gwt.dom.client.Element;
@bduisenov
bduisenov / Rx.java
Created December 18, 2015 14:11
gwt jsinterop for Rx.js
import jsinterop.annotations.JsFunction;
import jsinterop.annotations.JsMethod;
import jsinterop.annotations.JsType;
/**
* Created by bduisenov on 15/12/15.
*/
public class Rx {
@FunctionalInterface
@bduisenov
bduisenov / jQuery.java
Created December 18, 2015 14:09
gwt jsinterop for jQuery
import com.google.gwt.dom.client.Element;
import jsinterop.annotations.JsFunction;
import jsinterop.annotations.JsMethod;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsType;
/**
* Created by bduisenov on 27/10/15.
*/
@JsType(namespace = JsPackage.GLOBAL, name = "jQuery", isNative = true)