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 / compass-init.sh
Last active January 27, 2021 09:15
Compass sprite images
#!/bin/sh
if [ $1 ]; then
mkdir -p ./$1/src/sass
cd ./$1/
ln -s ~/public_html/sass/plugins ./src/sass/
compass init --css-dir static/css --images-dir static/i --javascripts-dir static/js --sass-dir src/sass -s nested --using blueprint
echo "Now You may run 'compass watch' at $1"
else
echo "usage: $project [project name]"
fi
@iegik
iegik / dabblet.css
Created October 26, 2012 11:50
Responsive Vertical Layout
/* Responsive Vertical Layout */
h2 { margin-top:0; margin-bottom: 1ex; font-variant: small-caps; background-color: rgba( 128, 128, 128, .5); position: relative; left: -.7ex; padding: 0 .7ex; width: 100%;}p { text-align: justify;}/* vresp */html { width: 100%; height: calc(100% - 8px);}.head, .main, .foot { min-height: 50px; background-color: rgba(129,130,128,.5); margin: 0 1ex 1ex; display:inline-block; width: calc( 100% - 2ex ); vertical-align: top;}.head, .foot { height: 25%; max-height: 120px;}.main { min-height: 300px; height: calc( 100% - 240px - 1ex ); white-space: nowrap; /* remove spaces between blocks */}.main > * { /* wrap text normaly */ white-space: normal; overflow: auto; max-height: calc( 100% - 2ex );} .wrap { max-width: 800px; min-width: 200px; width: 100%; margin: 0 auto; position: relative; height:100%;}body { height: 100%;}@media only screen and (max-height: 560px ) { /* 120 + 120 + 300 +
@iegik
iegik / bookmarks.html
Last active March 31, 2020 10:06
Useful browser scripts in shortcuts
<a href="javascript:window.history.back();">←</a>
<a href="javascript:(function(){window.location.search+='&webm=1';})();">yt:h5v</a>
<a href="javascript:(function(h){var r=h.innerHTML.match(/<!--\[if\s(?:[^<]+|<(?!!\[endif\]-->))*<!\[endif\]-->/gim);for(x in r){h.innerHTML+=r[x].replace(/<!--.*>/,'');};})(document.getElementsByTagName('html')[0]);">use IE styles</a>
<a href="javascript:(function(tags){var tag,obj={},all=0;for ( key in tags){tag = (tags[key].tagName+'').toLowerCase();all++;obj[tag]++ || (obj[tag]=1);}console.log('Tags:',obj);alert(all)})(document.getElementsByTagName('*'));">count html tags on page</a>
<a href="javascript:(function(b,w,h){b.style.width=w;b.style.height=h;b.style.overflow='hidden';})(document.getElementsByTagName('body')[0],'340px','640px')">iPhone</a>
<a href="javascript:(function(b,w,h){b.style.width=w;b.style.height=h;b.style.overflow='hidden';})(document.getElementsByTagName('body')[0],'1039px','768px')">iPad</a>
<a href="javascript:(function(b,w,h){b.style.width=w;b.style
@iegik
iegik / debug.php
Created December 4, 2012 13:06
Get classes, methods and it`s arguments
<?php
function get_func_argNames($funcName,$className=null) {
if($className){
$f = new ReflectionMethod($className,$funcName);
}else{
$f = new ReflectionFunction($funcName);
}
$result = array();
foreach ($f->getParameters() as $param) {
$result[$param->name] = $param->isOptional()?:'required';
@iegik
iegik / noized.js
Last active October 13, 2015 22:48
Replace broken images with noise
HTMLCanvasElement.prototype.addNoise = function(r, g, b, a, l) {
// default variables: red, green, blue, alpha, light
a||(a=-.4);
l||(l=.5);
//(!red&&green)||(alpha=green,green=128);
//(!green&&blue)||(brightness=blue,blue=128);
r||(r=1);
g||(g=1);
b||(b=1);
@iegik
iegik / mage777.sh
Last active July 26, 2024 07:54
Make Magento Template Path Hints hidden, to not distroy page layout
#!/bin/bash
find . -type d -exec chmod 777 {} \;
find . -type f -exec chmod 644 {} \;
sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx *
sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx *
@iegik
iegik / dropfont.js
Last active December 12, 2015 03:28
var doc = document.documentElement;
doc.ondragover = function () {
//this.className = 'hover';
return false;
};
doc.ondragend = function () {
//this.className = '';
return false;
};
doc.ondrop = function (event) {
@iegik
iegik / jsFiddle.html
Last active December 12, 2015 04:38
jsFiddle - good service, but... internet connection sometimes goes down, or simply server not respond. So, I create fast alternative for my favorite service, where I can play with fiddles locally. It uses localStorage, for savings.
<!DOCTYPE html>
<html>
<head>
<style>
body,html,form{height:100%;width:100%;
margin:0;
padding:0;
background-color: rgba(255,255,255,.5);
color: #222;
@iegik
iegik / README.md
Last active October 24, 2025 13:50
Collection of Regular Expressions
  • [\p{IsCyrillic}]+, [а-яА-ЯёЁ]+ - Cyrillic words
  • ^[\s\t]+?(font|background|border|link|vlink|color)(-\w+)?:.*$ - CSS property lines
-- Simple package with BDD
CREATE OR REPLACE PACKAGE simple_package IS
--
PROCEDURE BDD_example (
BDD ARRAY
);
END;
/
CREATE OR REPLACE PACKAGE BODY simple_package IS
PROCEDURE BDD_example (