Skip to content

Instantly share code, notes, and snippets.

View mervick's full-sized avatar

Andrey Izman mervick

View GitHub Profile
@mervick
mervick / gmail-scrollbars.css
Created March 23, 2016 04:13 — forked from jambu/gmail-scrollbars.css
New Gmail like scrollbars for webkit browsers
/* Gmail style scrollbar */
::-webkit-scrollbar {
width: 12px
}
::-webkit-scrollbar-thumb {
border-width: 1px 1px 1px 2px
}
::-webkit-scrollbar-track {
border-width: 0
}
@mervick
mervick / tm.bash
Created April 6, 2016 21:27 — forked from UiharuKazari2008/tm.bash
Altrix SSH Key Manager
# mv tm.bash /opt/tm.bash
# chmod +x /opt/tm.bash
# ln -s /opt/tm.bash /sbin/tm
# tm -h
# Move your untrusted keys in ~/authorized_keys with the following format
# shortname;longname;sshpublickey
# #;Remote-Untrusted
# workPC1;WorkPC-1-Win10;SOMESSHKEYSHIT
# flashPC;FlashDrivePuTTY;SOMEMORESSHKEYSHIT
@mervick
mervick / license-badges.md
Created June 22, 2016 19:53 — forked from lukas-h/license-badges.md
License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file. Easily copy and paste the code under the badges into your Markdown files.

Apache

Apache 2.0 License

License
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

BSD

@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.

@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 / 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 / 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 / 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 / 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;
@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 {