Skip to content

Instantly share code, notes, and snippets.

View Schepp's full-sized avatar

Christian Schaefer Schepp

View GitHub Profile
@Schepp
Schepp / gist:8036427
Created December 19, 2013 09:02
Bookmarklet that allow you to copy its output URL and insert that into a Twitter DM, without being blocked.
javascript:prompt('Copy this:',location.href.replace(/\./g,"\u200b."));return false;
@Schepp
Schepp / gist:7802899
Created December 5, 2013 10:00
Configure TinyMCE in a way that it filters out Word tagsoup
tinyMCE.init({
mode : "exact",
theme : "advanced",
language : "de",
valid_elements : "p,em/i,strong/b,br,strike,u,ul,ol,li",
theme_advanced_buttons1 : "undo,redo,bold,italic,underline,strikethrough,bullist,numlist,outdent,indent,code",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
apply_source_formatting : true,
entity_encoding : "named",
@Schepp
Schepp / gist:6338742
Last active December 21, 2015 17:09
Send CORS headers for CSS files only

Put this into the server's .htaccess file (assuming that it's an Apache):

<IfModule mod_headers.c>
  <FilesMatch "\.css$">
    Header set Access-Control-Allow-Origin "*"
  </FilesMatch>
</IfModule>
@Schepp
Schepp / gist:6304539
Created August 22, 2013 08:26
How to set IE compatibility mode via entry in Apache's .htaccess
<IfModule mod_headers.c>
# Set IE to render page as if it were an IE 7
Header set X-UA-Compatible "IE=7"
</IfModule>
# This .htaccess needs Apache with:
# mod_rewrite
# mod_headers
# mod_proxy
# SSL certificate
# Proxies "https://api.twitter.com.cors-proxy.io/1.1/statuses/mentions_timeline.json?count=2&since_id=14927799"
# To: "https://api.twitter.com/1.1/statuses/mentions_timeline.json?count=2&since_id=14927799"
# All while setting CORS header on the fly
file_put_contents($filename,base64_decode(str_replace(array(
'data:image/jpeg;base64,',
'data:image/png;base64,',
'data:image/gif;base64,',
),'',$datauri)));
@Schepp
Schepp / gist:5147513
Created March 12, 2013 22:03
Bookmarklet to have all stylesheets in the current page reload
javascript:(function(){$('link[rel="stylesheet"]').each(function(){var url=$(this).attr('href').replace(/[\?&][^\?&=]+=[0-9]+$/,'');url += (url.indexOf('?') == -1 ? '?' : '&') + 'nocache=' + (new Date()).getTime();console.log(url);$(this).attr('href',url);});})()
@Schepp
Schepp / dabblet.css
Created February 18, 2013 19:58
CSS Variables test
/**
* CSS Variables test
*/
background: red;
-webkit-var-foo: green;
-moz-var-foo: green;
-o-var-foo: green;
var-foo: green;
@Schepp
Schepp / dabblet.css
Created February 18, 2013 19:57
Untitled
div {
color: red;
-webkit-text-fill-color: transparent;
background: url(http://www.bittbox.com/wp-content/uploads/2008/04/free_hires_wood_texture_5.jpg);
-webkit-background-clip: text;
}
p {
color: #8B4813; /* Color to key out. Best if a median of bg image colors */
font-size: 120px;
filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ffffff',GradientType=0 ) /* Gradient fills with white */
@Schepp
Schepp / dabblet.css
Created February 4, 2013 18:38
Untitled
div {
color: red;
-webkit-text-fill-color: transparent;
background: url(http://www.bittbox.com/wp-content/uploads/2008/04/free_hires_wood_texture_5.jpg);
-webkit-background-clip: text;
}
p {
color: #8B4813; /* Color to key out. Best if a median of bg image colors */
font-size: 120px;
filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ffffff',GradientType=0 ) /* Gradient fills with white */