Skip to content

Instantly share code, notes, and snippets.

View iegik's full-sized avatar
🧾
Looking for work

Arturs Jansons iegik

🧾
Looking for work
View GitHub Profile
@iegik
iegik / Brackets.icls
Last active November 5, 2016 00:31
WebStorm Brackets theme
<scheme name="Brackets" version="142" parent_scheme="Default">
<option name="LINE_SPACING" value="1.0" />
<font>
<option name="EDITOR_FONT_NAME" value="Source Code Pro" />
<option name="EDITOR_FONT_SIZE" value="12" />
</font>
<font>
<option name="EDITOR_FONT_NAME" value="Monospaced" />
<option name="EDITOR_FONT_SIZE" value="12" />
</font>
@iegik
iegik / e2e_spec.js
Created August 25, 2015 16:51
Protractor e2e tests
'use strict';
var SomePage = require('../pages/SomePage');
describe('some', function () {
it('feature', function () {
var somePage = new SomePage();
expect(somePage.items.then(function (items) {
items[0].button.click();
return items[0].pane.isDisplayed();

Install dnsmasq

brew install dnsmasq

Add mask

echo '/*.local.ru/*.local.ir/*.local.com/*.local.co.il/127.0.0.1' &gt;&gt; $(brew --prefix)/etc/dnsmasq.conf
@iegik
iegik / README.md
Last active December 4, 2016 13:09
Custom Elements

Custom Elements

$.define('$.ui.container');
$.ui.container = function () {
	var self = $.ui.component.call(this);
	return self;
};
#!/bin/sh
# Adds column to CSV file
# addColumn.sh "field" "value" input.csv
TITLE=$1
VALUE=$2
INPUT=$3
OUTPUT=${INPUT%%.csv}"_fixed.csv"
sed '1!s/$/,"'$VALUE'"/;1s/$/,"'$TITLE'"/g' $INPUT > $OUTPUT
@iegik
iegik / sock.py
Last active August 29, 2015 14:24
Socket server in python using select function
#!/usr/bin/python
'''
Simple socket server using threads
http://tools.ietf.org/html/rfc6455
'''
import socket
import sys
HOST = '' # Symbolic name, meaning all available interfaces
@iegik
iegik / charset2utf8.sh
Created July 13, 2015 16:03
Converts original charset of the file to UTF-8
#!/bin/sh
# Converts original charset of the file to UTF-8
# require iconv, tr, grep | sed | awk
# grep wins: https://davidlyness.com/post/the-functional-and-performance-differences-of-sed-awk-and-other-unix-parsing-utilities
# grep -oe'[^=]*$'
# sed 's/[^=]*[=]//g'
# awk -F= '{print$2}'
for arg in "$@"; do
TMP=".${arg##*/}.$$";
@iegik
iegik / split.sh
Created June 29, 2015 15:17
Split file $1 into $2 chunks
#!/bin/bash
F_NAME=$1
CHUNKS=$2
ALL=`wc -l $F_NAME | awk '{print $1}'`
N=`expr $ALL / $CHUNKS`
A=0
# Getting CSV head
#head -n1 $F_NAME > ${F_NAME%%.csv}_head.csv
@iegik
iegik / Color.js
Last active August 29, 2015 14:21 — forked from neolitec/Color.js
var Color = function() {
this.r = this.g = this.b = 0;
this.h = this.s = this.l = 0;
this.a = 1;
};
/** RGB */
Color.prototype.cssRGB = function() {
return "rgb("+Math.round(255*this.r)+","+Math.round(255*this.g)+","+Math.round(255*this.b)+")";
};
Color.prototype.cssRGBA = function() {
@iegik
iegik / index.html
Last active August 29, 2015 14:21
myLib
<!DOCTYPE html>
<html lang="ru">
<head>
<link type="text/css" href="style.css" rel="stylesheet"/>
</head>
<body>
<script src="myLib.js"></script>
<script src="myLib.Observable.js"></script>