Skip to content

Instantly share code, notes, and snippets.

View TheGP's full-sized avatar
💭
Hold on. I'm recompiling the universe...

Eugene Bos TheGP

💭
Hold on. I'm recompiling the universe...
View GitHub Profile
@TheGP
TheGP / gist:840fceec4d1beba526c9dd753d503e83
Created October 28, 2016 10:42
css inliner's mistake
<!DOCTYPE html>
<html>
<head><meta name="charset" content="utf-8">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,700&amp;subset=cyrillic" rel="stylesheet" /><meta name="viewport" content="width=device-width, initial-scale=1"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta charset="UTF-8">
<style type="text/css">* {
font-size: 16px;
line-height: 150%;
}
body, a, p, h1, h2, h3, h4, span, div {
font-family: 'Open Sans', 'OpenSans', 'HelveticaNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif;
@TheGP
TheGP / gist:7d8793f2c3aaadaafb26f534b1921e16
Created October 24, 2016 19:04
mdp template test (remove)
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,700&subset=cyrillic" rel="stylesheet">
<!--[if gte mso 9]>
<img width="66" src="http://cdcs.makedreamprofits.ru/?57cfac0ebd225&0&{{_Email}}&gif&type=days" /><img width="66" src="http://cdcs.makedreamprofits.ru/?57cfac0ebd225&0&{{_Email}}&gif&type=hours" /><img width="66" src="http://cdcs.makedreamprofits.ru/?57cfac0ebd225&0&{{_Email}}&gif&type=minutes" />
@TheGP
TheGP / gist:653854504907b445ac5b
Created July 15, 2015 22:11
Turn off comebacker (cb) at any click on the page. jQuery is required.
var cb_to_turn_off_id = 123; // вставить ID камбекера который нужно отключить
var cb_turned_off = false;
$(document).ready(function(){
$('*').click(function(){
if ('undefined' != typeof(comebacker) && false == cb_turned_off) {
comebacker['settings']['launch'] = true;
comebacker_create_cookie('comebacker_was_shown[' + cb_to_turn_off_id + ']', 1, 365);
cb_turned_off = true;
}
});
@TheGP
TheGP / gist:e394b6416af7bbbd863c
Created April 20, 2015 18:29
pt - no popup with email form
<script>
var pt_no_popup_count = 0;
var pt_no_popup = setInterval(function(){
if (document.getElementById('cd-noemail-popup')) {
document.getElementById('cd-noemail-popup').style.display = 'none';
if (document.getElementById('pt-modal-backdrop'))
document.getElementById('pt-modal-backdrop').style.display = 'none';
pt_no_popup_count++;
@TheGP
TheGP / gist:a569a6c71df17c5923e6
Last active September 22, 2016 20:27
comebacker turn off for iframes (improved function)
/* jQuery('.articles iframe').first() должно быть подогнано под сайт. если там всего 1 ифрейм, то достаточно jQuery('iframe') */
var comebacker_no_more_off = false;
var comebacker_turn_off = setInterval(function(){
if ('undefined' != typeof(comebacker) && 'undefined' != typeof(comebacker['settings']) && true == comebacker['settings']['launch']) {
jQuery('iframe').on('mouseover', function(){ if (0 == jQuery('#comebacker_main_div iframe:visible').length) comebacker['settings']['launch'] = false; }).on('mouseout', function(){ if (0 == jQuery('#comebacker_main_div iframe:visible').length) comebacker['settings']['launch'] = true; });
window.clearInterval(comebacker_turn_off);
}
@TheGP
TheGP / gist:97de2814fb3dcd7ad449
Last active August 29, 2015 14:17
jumpout - show popup every time
<script>
function ss_create_cookie(e,n,t){if(t){var o=new Date;o.setTime(o.getTime()+24*t*60*60*1e3);var i="; expires="+o.toGMTString()}else var i="";var r=document.domain.substring(document.domain.lastIndexOf(".",document.domain.lastIndexOf(".")-1)+1);document.cookie=e+"="+n+i+"; path=/;domain=."+(6<r.length?r:document.domain)}
function ss_read_cookie(e){for(var n=e+"=",t=document.cookie.split(";"),o=0;o<t.length;o++){for(var i=t[o];" "==i.charAt(0);)i=i.substring(1,i.length);if(0==i.indexOf(n))return i.substring(n.length,i.length)}return null}
var popups_to_show_always = [85]; /* сюда записываем id попапов которые должны постоянно работать*/
var ss_clean_cookies = function(){
for (key in popups_to_show_always) {
var pp_id = popups_to_show_always[key];
if (null !== ss_read_cookie('jo_do_not_show[' + pp_id + ']')) {
@TheGP
TheGP / gist:3f9eda061db17a2c75a7
Last active August 29, 2015 14:16
reloading trello if connection is lost
// ==UserScript==
// @name Trello reload
// @namespace http://use.homepage/
// @version 0.1
// @description Script will check if trello lost an internet connection and will reload it if connection exists
// @match https://trello.com/*
// @copyright 2015+, You
// ==/UserScript==
function check_for_lost_connection() {
@TheGP
TheGP / gist:e1ad034191315b8e1740
Created March 9, 2015 16:26
jo show right away
<script>
var show_jo_right_now = setInterval(function(){
if ('undefined' != typeof(jo_show)) {
jo_show();
clearInterval(show_jo_right_now);
}
});
</script>
@TheGP
TheGP / 0_reuse_code.js
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console