var elems = [view1,view2,button1];
var events = ['touch','singletap','myownevent'];
for (var el=0;el< elems.length; el++) {
for (var ev=0; ev < events.length; ev++ ) {
elems[i].addEventListener(events[ev],callbackfunction);
}
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| henrique@henrique-Inspiron-3647:~/Desktop$ sudo apt-get update | |
| [sudo] password for henrique: | |
| Ign:1 http://us.archive.ubuntu.com/ubuntu yakkety InRelease | |
| Ign:2 http://us.archive.ubuntu.com/ubuntu yakkety-updates InRelease | |
| Ign:3 http://us.archive.ubuntu.com/ubuntu yakkety-backports InRelease | |
| Ign:4 http://us.archive.ubuntu.com/ubuntu yakkety-security InRelease | |
| Ign:5 http://us.archive.ubuntu.com/ubuntu yakkety Release | |
| Ign:6 http://us.archive.ubuntu.com/ubuntu yakkety-updates Release | |
| Ign:7 http://us.archive.ubuntu.com/ubuntu yakkety-backports Release | |
| Ign:8 http://us.archive.ubuntu.com/ubuntu yakkety-security Release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| static public function slugify($text) | |
| { | |
| // replace non letter or digits by - | |
| $text = preg_replace('~[^\pL\d]+~u', '-', $text); | |
| // transliterate | |
| $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text); | |
| // remove unwanted characters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| window.onload = function() { | |
| var heading = document.createElement("h1"); | |
| var heading_text = document.createTextNode("Big Head!"); | |
| heading.appendChild(heading_text); | |
| document.body.appendChild(heading); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //setup before functions | |
| var typingTimer; //timer identifier | |
| var doneTypingInterval = 5000; //time in ms, 5 second for example | |
| var $input = $('#myInput'); | |
| //on keyup, start the countdown | |
| $input.on('keyup', function () { | |
| clearTimeout(typingTimer); | |
| typingTimer = setTimeout(doneTyping, doneTypingInterval); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //RECONHECE SE É UM LINK (COMEÇANDO COM HTTPS, HTTP OU WWW) | |
| preg_match('/^(https?:\/\/)([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/', 'http://i.imgur.com/X7QXj8S.jpg') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $route['(:any)'] = 'home/index/$1'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $start = new DateTime('-7 days', new DateTimeZone('UTC')); | |
| $period = new DatePeriod($start, new DateInterval('P1D'), 7); | |
| foreach ($period as $date) { | |
| echo $date->format('D d-m-Y').'<br>'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| import Kingfisher | |
| //DEFINE A ESTRUTURA DA NOTICIA | |
| struct Noticia : Decodable { | |
| var noticias_id : String | |
| var cidade : String | |
| var titulo : String |
OlderNewer