Skip to content

Instantly share code, notes, and snippets.

@incompl
incompl / gist:6525355
Last active December 22, 2015 20:19
Samsung Galaxy S4 Browser Bugs

The Android Browser on this phone has bugs that are newly introcuded on this phone. It's kind of shameful TBH.

Confirmed

  • border-radius is broken
    • You need to spell out border radius as 4 properties.
    • Source
  • Gradient doesn't work
    • incorrectly implements unprefixed gradients
  • works with -webkit prefix
// Test basic messaging, to and from client
messageBasics: function(test) {
test.expect(2);
var server = this.server;
var client = createClient();
server.configure({
port: this.port,
// tearDown is called after every test
// Shut down server and all clients
tearDown: function(callback) {
try {
_(clients).forEach(function(client) {
if (client.connected()) {
console.log('ending client');
client.end();
}
else {
// Used in tests to create a new Cloak client. Using
// this function instead of doing it manually means
// clients will be properly cleaned up after tests
// are done.
function createClient() {
var client = createCloakClient();
client._setLibs(_, io);
clients.push(client);
return client;
}
// setUp is called before every test
// Pepare a server and an empty client list
setUp: function(callback) {
try {
this.port = 8091;
this.host = 'http://localhost:' + this.port;
this.server = cloakServer;
clients = [];
callback();
}
@incompl
incompl / anything-boilerplate.js
Created August 9, 2013 16:30
JavaScript Boilerplate - A Boilerplate For Literally Any JavaScript Program
// JavaScript Boilerplate 0.1
@incompl
incompl / gaunt-prettify.js
Created August 8, 2013 15:22
Gaunt syntax highlighter. Try running it on http://tinysubversions.com/gaunt/
var code = document.querySelector('code');
code.innerHTML = code.innerHTML.replace(/\u0020/g, '<span class="s">\u0020</span>')
.replace(/\u0009/g, '<span class="t">\u0009</span>');
var styleElem = document.createElement('style');
document.getElementsByTagName('head')[0].appendChild(styleElem);
var stylesheet = document.styleSheets[document.styleSheets.length - 1];
stylesheet.insertRule('.s { background-color: #faf; }', 0);
stylesheet.insertRule('.t { background-color: #afa; }', 1);
@incompl
incompl / standalone-links.js
Last active December 20, 2015 12:39
jQuery code to keep your site in webapp mode on iOS when clicking links. Bonus feature: links that have the `external` class will switch to Safari when clicked.
@incompl
incompl / settings
Created March 9, 2013 20:07
my SublimeLinter settings
{
"sublimelinter_disable": ["css"],
"sublimelinter_mark_style": "fill",
// http://www.jshint.com/options/
"jshint_options": {
"evil": true,
@incompl
incompl / rdbm.js
Created February 23, 2013 16:11
Responsive Design Bookmarklet. Turns the screen blood red if there is a horizontal scrollbar.
function g(){if (document.body.clientWidth !== document.body.scrollWidth){document.body.style.display="none";document.getElementsByTagName("html")[0].style.background="red";}}window.addEventListener("resize", g);g();