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 / .commitlintrc
Last active February 19, 2025 09:28
Git configuration and aliases
{
"extends": [
"@commitlint/config-conventional"
],
"parserOpts": {
"headerPattern": "/^(\\w*)\\((\\w*)\\): (\\w*)\\s(.*)$/",
"headerCorrespondence": [
"type",
"scope",
"ticket",
{
"brackets-file-tree-exclude.excludeList": [
"/.git/",
"/bower_components/",
"/node_modules/"
],
"interactive-linter.javascript": [
"eslint"
]
}
@iegik
iegik / .editorconfig
Last active September 28, 2022 07:48
EditorConfig
root = true
[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = true
@iegik
iegik / .eslintrc
Last active September 28, 2022 08:15
ESLint
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["react", "react-native", "import"],
"extends": [
"eslint:recommended",
"plugin:import/recommended",
"plugin:react-native/all",
"plugin:prettier/recommended"
],
@iegik
iegik / watch_templates.sh
Created March 30, 2016 08:09
Example of watching file and executing command on modify event
#!/bin/bash
while inotifywait -e modify application/views/html/**/*; do make templates; done
@iegik
iegik / crawler.js
Created March 1, 2016 15:35
crawler
'use strict';
var domain = 'http://example.com',
sm = {
data: {},
meta: {
keywords: document.querySelector('meta[name=keywords]').content,
description: document.querySelector('meta[name=description]').content,
length: 0
}
@iegik
iegik / bashrc
Last active October 23, 2016 19:47
Git tools
splitdiff() { sed '/<<<<<<</,/=======/d;/>>>>>>>/d' $1 > $1.REMOTE; sed '/<<<<<<</d;/=======/,/>>>>>>>/d' $1 > $1.LOCAL; echo $1; }
automerge() { mv $1 $1.BASE;git checkout BASE $1; meld --auto-merge $1.LOCAL $1 $1.REMOTE; echo $1; }
closemerge() { git add $1; rm $1.BASE $1.LOCAL $1.REMOTE; echo $1; }
mergetool() { splitdiff $1 && automerge $1 && closemerge $1; }
@iegik
iegik / keywords.php
Last active May 19, 2016 12:31
Text tool to get useful keywords to describe it
<div style="width:550px">
<form method="POST">
<textarea name="text" style="width:100%" rows="20"><?=($_POST['text'])?$_POST['text']:''?></textarea>
<input type="submit"/>
<pre>
<?php
function keywords1($text){
$text = preg_replace('/[\!-@\[-\x60\x7b\x7e]/',' ',mb_strtolower($text,'UTF-8'));
$text = preg_replace('/\s+/',' ',$text);
@iegik
iegik / sokr.php
Created October 24, 2015 19:01
Сокращает текст до легко распозноваемого и читаемого
<div style="width:550px">
<form method="POST">
<textarea name="text" style="width:100%" rows="20" placeholder="Сокращает текст до легко распозноваемого и читаемого." onclick="this.value="<?=(@$_POST['text'])?$_POST['text']:'ddd'?>"><?=(@$_POST['text'])?$_POST['text']:''?></textarea>
<input type="submit"/>
</form>
</div>
<pre>
<?php
$sokr = array(
@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>