#Stay Standalone
A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.
| // WARNING: This is an antipattern, just to explain for a friend of mine how this could work | |
| // Don't do this is serious projects. | |
| function calendarLoop() { | |
| $.ajax({ | |
| url:'/calendario/adicionar', | |
| dataType: 'json', | |
| data: {}, // an object to be serialized or string in param format data1=foo&data2=bar | |
| success: function(data) { | |
| if(data.repeat) { |
| # Copyright (c) 2009, Sunlight Foundation | |
| # All rights reserved. | |
| # | |
| # Redistribution and use in source and binary forms, with or without modification, | |
| # are permitted provided that the following conditions are met: | |
| # | |
| # * Redistributions of source code must retain the above copyright notice, | |
| # this list of conditions and the following disclaimer. | |
| # * Redistributions in binary form must reproduce the above copyright notice, | |
| # this list of conditions and the following disclaimer in the documentation |
| MIT License | |
| =========== | |
| Copyright (c) 2009–2011 | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |
| var client = new XMLHttpRequest(); | |
| var doThings = function(data){ | |
| console.dir(JSON.parse(data)); | |
| }; | |
| client.onreadystatechange = function(){ | |
| if (this.readyState == 4) { | |
| doThings(this.responseText); | |
| } | |
| }; | |
| client.open("GET", "http://search.twitter.com/search.json?q=from:tw2113"); |
#Stay Standalone
A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.
| <?php | |
| // top of file | |
| function mail_utf8($to, $subject, $message, $header) { | |
| $header_ = 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/plain; charset=UTF-8' . "\r\n"; | |
| $subject = "[Site Java2G] " . $subject; | |
| $message = $message . "\r\n\r\n-- Mensagem enviada através do site\r\n\r\n"; | |
| mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=', $message, $header_ . $header); | |
| } | |
| if($_POST['name'] || $_POST['email'] || $_POST['subject'] || $_POST['message']) { |
| Modernizr.addTest('pointerevents',function(){ | |
| var div = document.createElement('div'); | |
| if ('pointerEvents' in div.style) return true; | |
| 'Webkit Moz O ms Khtml'.replace(/([A-Za-z]*)/g,function(val){ | |
| if (val+'PointerEvents' in div.style) return true; | |
| }); | |
| }); |
| /* My wish for a new CSS parser/compiler */ | |
| /* input */ | |
| @define avatar-float { | |
| variable:$direction; | |
| float:$direction; | |
| margin-$direction:5px; | |
| padding:5px; | |
| } |
| // ==UserScript== | |
| // @name Vimeo BIG | |
| // @namespace http://irae.pro.br/userscripts/ | |
| // @include http://vimeo.com/* | |
| // ==/UserScript== | |
| (function() { | |
| var elem, elems, i; | |
| (function(){ | |
| var global = this; // capture global object, almost the same as window | |
| function touchScroll(wrapper,container,items,width,height){ | |
| var box = wrapper, | |
| move = container, | |
| itens = items, | |
| width = width, | |
| height = height, | |
| touchOrigin = null, |