Skip to content

Instantly share code, notes, and snippets.

View mervick's full-sized avatar

Andrey Izman mervick

View GitHub Profile
@nikoskip
nikoskip / gfonts.php
Last active February 2, 2025 08:26
Demo: http://nikoskip.me/gfonts.php | You only have to use the CSS import URL that Google gives you, for instance: http://fonts.googleapis.com/css?family=Cabin:500,700,500italic,700italic
<?php
$fontTypes = array('woff2', 'woff', 'ttf', 'svg', 'eot');
$gFontURL = 'http://fonts.googleapis.com/css?family=';
$uaFonts = array(
'woff2' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36',
'woff' => 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/4.0; GTB7.4; InfoPath.3; SV1; .NET CLR 3.1.76908; WOW64; en-US)',
'ttf' => 'Mozilla/5.0 (Linux; U; Android 2.2.1; en-ca; LG-P505R Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',
'svg' => 'Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10',
@muammar
muammar / getFirafonts.sh
Created May 23, 2016 08:41
Download and install Fira fonts in Linux or Mac OS X
#!/bin/bash
## cf from http://programster.blogspot.com/2014/05/ubuntu-14-desktop-install-fira-sans-and.html
cd /tmp
# install unzip just in case the user doesn't already have it.
if [[ `uname` = Linux ]]; then
sudo apt-get install unzip -y
wget "http://www.carrois.com/downloads/fira_4_1/FiraFonts4106.zip"
@MoOx
MoOx / autoscroll.js
Last active June 21, 2019 01:40
Auto scroll to proper active (form) element when keyboard open (may be useless on iOS, but useful on Android)
// auto scroll to proper active (form) element when keyboard open
// may be useless on iOS, but useful on Android
function scrollToActiveElement() {
if (document.activeElement && document.activeElement.scrollIntoViewIfNeeded) {
document.activeElement.scrollIntoViewIfNeeded()
}
}
window.addEventListener("resize", () => {
setTimeout(scrollToActiveElement, 200)
setTimeout(scrollToActiveElement, 1000) // just in case browser is slow
@UiharuKazari2008
UiharuKazari2008 / tm.bash
Last active June 24, 2016 21:39
Altrix SSH Key Manager
# NOTICE!! This project has permantly oved to GitLain: https://gitla.in/UiharuKazari2008/ShiraiTrust/blob/master/tm.bash
# SSH Trust Manager: Allows a user to control SSH key login.
# By: Yukimi Kazari for the TangleroadFX API (see https:\\acr.moe for info)
# Version 0.2
# Install
# Save this as tm.bash
# mv tm.bash /opt/tm.bash # Put it a safe place
# chmod +x /opt/tm.bash # Make Runable
# chmod +x /usr/bin/tm.bash # Make Runable
@Unibozu
Unibozu / README.md
Last active September 8, 2021 06:31
Shutter - Linux - dropbox automatic screenshot url to clipboard

Shutter - Dropbox automatic screenshot URL to Clipboard

Installation

  1. Configure shutter to save your screenshot directly intoyour dropbox public folder.
  2. Place dropbox-puburl.sh in the location of your choice (here ~/tools/bin/dropbox-puburl.sh)
  3. Place dropbox-screenshot-puburl.desktop into /usr/share/applications (you need to be root)
  4. Eventually update the path to your Bash script
  5. exec sudo update-desktop-database
  6. Quit and restart shutter. Go into Preferences &gt; Actions &gt; Open With and select Dropbox copy public file URL to clipboard
@lukas-h
lukas-h / license-badges.md
Last active April 28, 2025 11:10
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)

@drmalex07
drmalex07 / README-setup-tunnel-as-systemd-service.md
Last active April 7, 2025 13:24
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/[email protected]. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
anonymous
anonymous / 3D Offcanvas Menu.markdown
Created November 30, 2015 04:01
3D Offcanvas Menu
@AllThingsSmitty
AllThingsSmitty / toggle-css-script-on-off.js
Created November 15, 2015 19:39
Disable/enable a stylesheet or script
// Use the Boolean `disabled` attribute
myCSS.disabled = true;
myJS.disabled = true;
// Create a stylesheet toggle button:
var stylesheet = document.getElementById('boot'),
btn = document.querySelector('.btn');
btn.addEventListener('click', function () {
stylesheet.disabled = (stylesheet.disabled === false) ? true : false;
@Nilpo
Nilpo / Using Git to Manage a Live Web Site.md
Last active April 24, 2025 23:08
Using Git to Manage a Live Web Site

Using Git to Manage a Live Web Site

Overview

As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.

Contents