Resources for learning web design & front-end development:
ONLINE
Design
Resources for learning web design & front-end development:
ONLINE
Design
| function API_YOUTUBE($video,$ancho,$alto) | |
| { ?> | |
| <div class="embed-responsive embed-responsive-16by9 bordevideo"> | |
| <script asyn defer> | |
| var tag=document.createElement('script'); | |
| tag.src ="https://www.youtube.com/player_api"; | |
| var firstScriptTag =document.getElementsByTagName('script')[0]; | |
| firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); | |
| var player; | |
| function onYouTubePlayerAPIReady(){ |
| // Si son varias separar por comas | |
| // en este ejemplo se carga la fuente "lato" | |
| // debe colocarse en el head | |
| // es para no usar | |
| // <link href='https://fonts.googleapis.com/css?family=Lato:400,900,700' rel='stylesheet' type='text/css'> | |
| <script type="text/javascript" async defer> | |
| WebFontConfig={google:{families:['Lato:400,900,700']}}; | |
| (function(){var wf=document.createElement('script'); | |
| wf.src=('https:'==document.location.protocol ? 'https' : 'http') + '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js'; | |
| wf.type='text/javascript';wf.async='true'; |
| # extraer la ubicacion (latitud y longitud) | |
| # desde Google Maps | |
| # | |
| function CLIMA($latitud,$longitud) | |
| { $url = "http://api.openweathermap.org/data/2.5/weather?lat=$latitud&lon=$longitud&units=metric"; | |
| # -------------------- | |
| $clima = file_get_contents($url); | |
| $json = json_decode($clima); | |
| $temperatura = $json->main->temp; |
| <?php | |
| /* ------------------------------------------------------- | |
| Script bajo los términos y Licencia | |
| GNU GENERAL PUBLIC LICENSE | |
| Ver Terminos en: | |
| http://www.gnu.org/copyleft/gpl.html | |
| Autor:Hector A. Mantellini (Xombra) |
| # | |
| # Lee un RSS/XML de una url determinada | |
| # | |
| function RSS($url,$imagen) | |
| { global $entries; | |
| if (VERIFICA_ONLINE($url)){ | |
| $noticias = simplexml_load_file($url); | |
| $largo=700; | |
| $lee=3; | |
| $ciclo = 1; |
| # | |
| # verifica si una pagina esta online o existe | |
| # | |
| function VERIFICA_ONLINE($url) | |
| { @$headers = get_headers($url); | |
| if (stristr ($headers[0],'200 OK')) | |
| { return true; } | |
| else { return false; } | |
| } |
| function GoogleAnalytics($UA, $dominio) | |
| { echo " | |
| <script> | |
| (function(i,s,o,g,r,a,m) | |
| {i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
| (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
| m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
| })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
| ga('create', '$UA', '$dominio'); | |
| ga('require', 'displayfeatures'); |
| function CREAR_TOKEN($TokenForm) | |
| { $token = md5(uniqid(microtime(), true)); | |
| $token_time = time(); | |
| $_SESSION['csrf'][$TokenForm.'_token'] = array('token'=>$token, 'time'=>$token_time); | |
| return $token; | |
| } | |
| function VERIFICA_TOKEN($TokenForm, $token) | |
| { if(!isset($_SESSION['csrf'][$TokenForm.'_token'])) { | |
| return false; | |
| } |
| <?php | |
| # Extrae imagenes de un usuario y se filtra por los hastag | |
| # | |
| # Uso: | |
| # Debe crear un archivo .txt de nombre data.txt | |
| # Debe crear una carpeta de nombre grabar | |
| # | |
| /* |