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 / code_hightlighter.js
Created February 20, 2012 09:51
JavaScript: Code hightlighter
/*
.js-type {font-weight:700}
.js-variable, .js-type{color: #228}
.js-keyword{color: #708}
.js-string {color:#a22}
.js-punctuation {color:#666}
.js-atom {color:#281}
.js-comment, .js-comment * {color: #A70!important}
*/
String.prototype.hightlight = function(){
@iegik
iegik / style.scss
Created February 28, 2012 03:16
HTML5 Boilerplate feat. OOCSS Compass
/*
* HTML5 Boilerplate
*
* What follows is the result of much research on cross-browser styling.
* Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
* Kroc Camen, and the H5BP dev community and team.
*
* Detailed information about this CSS: h5bp.com/css
*
* ==|== normalize ==========================================================
@iegik
iegik / image.php
Last active October 2, 2015 00:27
make transparent image with text image.php/{title}-{width}x{height}-{hexcolor}.[png|jpeg|gif|webp|xbm|wbmp|gd|gd2]
<?php
/* Placehold transparent image
* image.php/{title}-{width}x{height}-{hexcolor}.[png|jpeg|gif|webp|xbm|wbmp|gd|gd2]
*
* @require: php_gd2,
*/
header('Last-Modified: ' . gmdate('D, d M Y H:i:s T', filemtime(__FILE__)));
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) &&
@iegik
iegik / bindmouseweel.js
Created April 24, 2012 06:22
Binding mouseweel event
/*
adds events to the mouse and left / right keys
http://brandonaaron.net/code/mousewheel/docs
*/
$(document).bind('mousewheel', function(e, delta) {
if(delta > 0) {
stopSlideshow();
rotateImages(0);
}
else {
@iegik
iegik / HTMLMail.php
Created June 26, 2012 07:43
Mail object, can convert simple html with inline styles to html mail
#!/usr/bin/php
<?php
require_once('ChromePhp.php');
class HTMLMailPart{
public $content;
public $type;
public $name;
public $path;
@iegik
iegik / bootstrap-editor.js
Created July 9, 2012 13:08
Bootstrap HTML5 Editor
$.fn.editable = function(options) {
var opts = $.extend({}, $.fn.editable.defaults, options);
return this.each(function() {
this.style.webkitApperiance = 'textarea';
this.contentEditable=true;
});
}
$.fn.editable.defaults = {
}
@iegik
iegik / reset.css
Created July 18, 2012 14:54
CSS Typography reset
html, body, div, span, applet, object, iframe, table, caption,
tbody, tfoot, thead, tr, th, td, del, dfn, em, font, img, ins,
kbd, q, s, samp, small, strike, strong, sub, sup, tt, var,
h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr,
acronym, address, big, cite, code, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend {
vertical-align: baseline;
font-family: inherit;
font-weight: inherit;
font-style: inherit;
@iegik
iegik / png2gif.py
Created July 19, 2012 11:39
Converting PNG to GIF saving travsparent color
#!/usr/bin/env python
# Convert PNG images to GIF, preserving transparency
# 2008 - http://www.coderholic.com/png2gif
import sys
import Image
import random
import optparse
import os
@iegik
iegik / _gradients.css.scss
Created July 30, 2012 12:32 — forked from thbar/_gradients.css.scss
SCSS mixing for CSS3 gradients
@mixin gradient($from, $to) {
/* fallback/image non-cover color */
background-color: $from;
/* Firefox 3.6+ */
background-image: -moz-linear-gradient($from, $to);
/* Safari 4+, Chrome 1+ */
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from($from), to($to));
@iegik
iegik / gitignore2svnignore.sh
Last active July 1, 2025 06:26 — forked from luisfaceira/converter.sh
Oneliner to convert svn:ignore into .gitignore
#!/bin/bash
cat .gitignore | sed 's/^/\.\//g;s/\(.*\)\/\([0-9a-zA-Z\*\?\.]*\)$/svn propedit svn:ignore "\2" \1 /mg' | bash