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 / README.md
Last active September 9, 2022 07:04
oneliners

echo

echo "Hello, World"
cat <<< "Hello, World"
@iegik
iegik / sfddiff.sh
Last active January 27, 2021 09:19
FontForge scripts
#!/usr/local/bin/fontforge
#This is the sfddiff script which compares two fonts
if ( Strtol($version) < 20060330 )
Error( "Please upgrade to a more recent version of fontforge" )
endif
flags=0x789
outfile=""
@iegik
iegik / RESTFulAPI_client.js
Last active January 11, 2023 12:31
RESTful cURL
// JavaScript
// Helpers
function serialize(o){
return Object.keys(o).reduce(function (previous, key) {
return previous + (previous?'&':'') + key + '=' + o[key];
},'');
}
@iegik
iegik / rygtlbvpn.xpm
Created December 1, 2014 14:52
rygtlbvpn
R c #FF0000
Y c #FFFF00
G c #00FF00
T c #88FF88
L c #00FFFF
B c #0000FF
V c #FF00FF
P c #FF0088
c None
RYG
@iegik
iegik / 304_file.php
Last active August 29, 2015 14:05
PHP caching samples
<?php
// Return 304 when files are not changed
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) &&
strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) >= filemtime(__FILE__))
{
header('HTTP/1.0 304 Not Modified');
exit;
}
@iegik
iegik / mysql.md
Last active September 16, 2019 12:04

Set ordinal number from #1 for data group #6

select @rownum := 0;
update a set a.orderid = @rownum:=@rownum+1 where a.groupid = 6;
groupid orderid
6 1
6 2
#!/bin/bash
# Checks the files and directories permissions of the web application
Options=$@
Optnum=$#
httpd_group="www"
app_owner="wwwrun"
app_group="wwwdata"
app_path="."
@iegik
iegik / Bash.md
Last active January 24, 2025 18:06
Bash script template

Bourne Again SHell

Piping stdin

#!/bin/bash
if [[ -p /dev/stdin ]]
    then
    PIPE=$(cat -)
    echo "PIPE=$PIPE"
fi
@iegik
iegik / README.md
Last active January 27, 2021 08:09
How to code HTML Email

How to code HTML Email

  • If you want to play it safe, shoot for anywhere between 500 to 600 pixels. I decided that a 550 width is visible in all scenarios. As for html email height, you have between 250-370 pixels before the fold.
  • Combine as many images in one to reduce the total number of Big Red Xs seen by a viewer with images off.
  • Gmail does not support CSS unless it is inline. Gmail does not support CSS font-family, the default font is Arial.
  • Always use “Alt” tags to describe the missing image. Inline styles can be applied to FONT tag
@iegik
iegik / .bash_aliases
Last active November 22, 2023 13:32
Development environment
# Aliases
# To unset alias use: `unalias ...`
alias ll='ls -lG'
alias ss='stat --printf="%A\t%a\t%h\t%U\t%G\t%s\t%.19y\t%n\n"'
#alias traceroute='tracert -d'
alias timestamp='date +%Y%m%d%H%M%S'
alias iso='date +%Y-%m-%dT%H:%M:%S'
# brew install w3m
alias html2text="w3m -dump -T 'text/html'"
alias untar="tar -zxvf"