Skip to content

Instantly share code, notes, and snippets.

View SynCap's full-sized avatar

Constantin Losk SynCap

View GitHub Profile
@SynCap
SynCap / blur.css
Created November 20, 2015 04:52
Cross browser blur effect in CSS/CSS3
.blur {
-webkit-filter: url(#blur);
filter: url(#blur);
-webkit-filter: blur(3px);
filter: blur(3px);
filter:progid:DXImageTransform.Microsoft.Blur(PixelRadius='3');
-webkit-transition: 1s -webkit-filter linear;
transition: 1s filter linear;
}
.blur:hover {
.noselect {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
@SynCap
SynCap / css3-lineart-the-page-icon.markdown
Created August 23, 2016 16:58
CSS3: LineArt - the page icon

CSS3: LineArt - the page icon

One block element styled as icon. No additional markup, just CSS.

A Pen by SynCap on CodePen.

License.

@SynCap
SynCap / index.jade
Created August 23, 2016 16:59
Oldtimer Terminal with blinking cursor in CSS3
.terminal.
Dedicated to memory of
#[b.nobr "EC-ЭBM 70"].
#[br]#[br]
Do you really remember
80th in USSR? [Y/n]
@SynCap
SynCap / css3-striped-zebra-background-for-any-text.markdown
Created August 23, 2016 16:59
CSS3: striped (zebra) background for any text

CSS3: striped (zebra) background for any text

Zebra style background for text, code, etc. Applicable to any brightness or hue of base color for background. Try to change it. To check corrections for sizes, try to set large enough quantity of lines (100 - 300) in HTML template.

A Pen by SynCap on CodePen.

License.

@SynCap
SynCap / ssh_client.py
Created December 21, 2016 06:47 — forked from ghawkgu/ssh_client.py
Python ssh client sample
#!/usr/bin/env python
import paramiko
hostname = 'localhost'
port = 22
username = 'foo'
password = 'xxxYYYxxx'
if __name__ == "__main__":
@SynCap
SynCap / gist:4e6059d9ec99348a55bf94938b2df590
Created January 9, 2017 14:41
Определение города посетителя. Detect user city, region, country via Yandex API & jQuery.
// Определение города посетителя
// Готовый код вставки в любое место сайта с указанием города, региона и страны.
<script src="http://yastatic.net/jquery/2.1.1/jquery.min.js"></script>
<script src="http://api-maps.yandex.ru/2.0-stable/?load=package.standard&lang=ru-RU" type="text/javascript"></script>
<script type="text/javascript">
window.onload = function () {
jQuery("#user-city").text(ymaps.geolocation.city);
jQuery("#user-region").text(ymaps.geolocation.region);
jQuery("#user-country").text(ymaps.geolocation.country);
}
@SynCap
SynCap / mysql_session_storage.php
Last active March 20, 2017 12:19
Store session data in MySQL database. Incredibly fast then in compare to built-in storage
<?php
/**
* Session Handling Functions using MySQL.
* simply include() this file at the top of any script you wish to use sessions in.
* As long as the table exists in the database, all sessions will be stored in that table.
* This file can be places onto multiple webservers running the same website and they will
* begin to share sessions between them.
*/
@SynCap
SynCap / remove_node_modules_recursively.ps1
Last active May 3, 2024 21:37
Remove `node_modules` folders in Windows in all subfolders recursively with PowerShell to avoid exceeding path max_length
<#
Note: Eliminate `-WhatIf` parameter to get action be actually done
Note: PS with version prior to 4.0 can't delete non-empty folders
#>
Get-ChildItem -Path "." -Include "node_modules" -Recurse -Directory | Remove-Item -Recurse -Force -WhatIf
@SynCap
SynCap / spacen.sh
Last active August 24, 2019 05:04
Bash find & sed to trim trailing spaces & convert indents
#!/bin/bash
# search for js, php & css files from current dir and below
# trim trailing spaces and tabs
# replace groups of 4 spaces to tab
# TODO: replace indents only, ie - only spaces at start of lines
# Problem: indentation tabs number must exact match to number of full spaces' groups
find ./ -type f -regex ".*\.\(js\|php\|css\)$" -exec sed -i -r 's/[ \g]+$//;s/^ {4}/\t/g' {} \;