Skip to content

Instantly share code, notes, and snippets.

View mervick's full-sized avatar

Andrey Izman mervick

View GitHub Profile
@mervick
mervick / nginx-font-serving
Created May 24, 2017 23:14 — forked from atiw003/nginx-font-serving
Nginx header write for serving fonts to firefox cross domain
For nginx,
location ~* \.(eot|ttf|woff)$ {
add_header Access-Control-Allow-Origin *;
}
Or better way inside virtual host location use,
Inside location use
if ($request_filename ~* ^.?/([^/]?)$)
@mervick
mervick / nano_js_syntax_highlighting.md
Created May 14, 2017 00:42 — forked from leommoore/nano_js_syntax_highlighting.md
nano javascript syntax highlighting

#nano javascript syntax highlighting

The existing syntax highlighting is located in /usr/share/nano/

To add a new language

sudo nano /usr/share/nano/javascript.nanorc

Put the following in the contents:

@mervick
mervick / Doxygen
Created April 25, 2017 05:19 — forked from itarato/Doxygen
Doxygen example for PHP code
# Doxyfile 1.8.9
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "Cameron & Wilding Tool"
PROJECT_NUMBER =
PROJECT_BRIEF = "Drupal 7 Architecture tool"
PROJECT_LOGO = /Users/itarato/Desktop/logo.png
@namespace url(http://www.w3.org/1999/xhtml);
@namespace svg url(http://www.w3.org/2000/svg);
@-moz-document regexp("^https?://((raw[2-9]*|gist|guides|help|status|developer)\.)?github\.com.*") {
/***********************************************
* Github Dark Theme v1.8.7 (3/22/2014)
* https://github.com/StylishThemes/GitHub-Dark
* http://userstyles.org/styles/37035
* License: http://sam.zoy.org/wtfpl/
***********************************************/
body {
@mervick
mervick / carbon.css
Created March 5, 2017 01:10 — forked from dfeng/carbon.css
Reddit Carbon
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain('reddit.com') {
body{
background:#1a1a1a;
color:#ddd
}
.comment .usertext .md p>a:visited,.md a,.res.res-nightmode .tagline a,a,h2 a:visited{
color:#3498db;
@mervick
mervick / bash.generate.random.alphanumeric.string.sh
Created November 29, 2016 03:25 — forked from earthgecko/bash.generate.random.alphanumeric.string.sh
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@mervick
mervick / nginx
Created November 28, 2016 07:15 — forked from pzorn/nginx
php-fpm and nginx init.d script
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemin
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /usr/local/nginx/conf/nginx.conf
# pidfile: /usr/local/nginx/logs/nginx.pid
@mervick
mervick / handlebars-helper-x.js
Created August 14, 2016 07:53 — forked from akhoury/handlebars-helper-x.js
Handlebars random JavaScript expression execution, with an IF helper with whatever logical operands and whatever arguments, and few more goodies.
// for demo: http://jsbin.com/jeqesisa/7/edit
// for detailed comments, see my SO answer here http://stackoverflow.com/questions/8853396/logical-operator-in-a-handlebars-js-if-conditional/21915381#21915381
/* a helper to execute an IF statement with any expression
USAGE:
-- Yes you NEED to properly escape the string literals, or just alternate single and double quotes
-- to access any global function or property you should use window.functionName() instead of just functionName()
-- this example assumes you passed this context to your handlebars template( {name: 'Sam', age: '20' } ), notice age is a string, just for so I can demo parseInt later
<p>
{{#xif " this.name == 'Sam' && this.age === '12' " }}
@mervick
mervick / gist:39b904f37551b89c3ff1cbc0ca719fe0
Created July 19, 2016 21:59 — forked from vladimirtsyupko/gist:10964772
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master
@mervick
mervick / A.markdown
Created July 3, 2016 23:08 — forked from larrybotha/A.markdown
Fix SVGs not scaling in IE9, IE10, and IE11

Fix SVG in <img> tags not scaling in IE9, IE10, IE11

IE9, IE10, and IE11 don't properly scale SVG files added with img tags when viewBox, width and height attributes are specified. View this codepen on the different browsers.

Image heights will not scale when the images are inside containers narrower than image widths. This can be resolved in 2 ways.

Use sed in bash to remove width and height attributes in SVG files

As per this answer on Stackoverflow, the issue can be resolved by removing just the width and height attributes.