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 | |
function parseFavicon($html) { | |
$s = '[ \t\r\n]*?'; | |
// Get the 'href' attribute value in a <link rel="icon" ... /> | |
// Also works for IE style: <link rel="shortcut icon" href="http://www.example.com/myicon.ico" /> | |
// And for iOS style: <link rel="apple-touch-icon" href="somepath/image.ico"> | |
$matches = array(); | |
// Search for <link rel="icon" type="image/png" href="http://example.com/icon.png" /> | |
; |
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
// http://stackoverflow.com/questions/8917921/cross-browser-javascript-not-jquery-scroll-to-top-animation/23844067#23844067 | |
// e = element to scroll to or top position in pixels, d = time to scroll in ms | |
function scrollTo(e,d){if(d>=0){var h=document.documentElement;if(h.scrollTop===0){var t=h.scrollTop;++h.scrollTop;h=t+1===h.scrollTop--?h:document.body}typeof e==="object"&&(e=e.offsetTop);scrollToX(h,h.scrollTop,e,0,1/d,20)}} | |
/* | |
e = scrollable element | |
a = initiall scrollable element position (from) | |
b = height to scroll to (to) | |
t = lerp from a to b (0 - 1) | |
v = speed. input 1 / time to scroll |
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
/* ************************************************************************** | |
Copyright 2012 Calvin Rien | |
(http://the.darktable.com) | |
Derived from a method in BuildManager, part of | |
VoxelBoy's Unite 2012 Advanced Editor Scripting Talk. | |
(http://bit.ly/EditorScripting) | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. |
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
function add() { | |
var slice = Array.prototype.slice, t = 0; | |
function add2(k) { | |
k = slice.call(arguments); | |
for(var j in k) | |
t += k[j]; | |
return add2; | |
} | |
add2.valueOf = function(){return t}; | |
return add2.apply(null, slice.call(arguments)); |
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
var tabla_videos = document.getElementById("pl-video-table"); | |
var boton_siguiente = tabla_videos.nextSibling.nextSibling; | |
console.log(tabla_videos); | |
console.log(boton_siguiente); | |
carga_mas_videos(function() { | |
//Todos los vídeos están cargados |
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
// Get the minimum radius sphere of a camera in which the camera crosses something. For a spherecast, for example. | |
public static float GetRadiusOfCamera(Camera camera) { | |
/* | |
Calculate the radius of the smallest sphere that contains perfectly the camera | |
The vertices of the sides of the near plane must touch the sphere and the | |
and also from the near plane center going backwards by camera.nearClipPlane | |
SIDE | |
_________ | |
/ /| \ |
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
Shader "Mattatz/SobelFilter" { | |
Properties { | |
_MainTex ("Base (RGB)", 2D) = "white" {} | |
_DeltaX ("Delta X", Float) = 0.01 | |
_DeltaY ("Delta Y", Float) = 0.01 | |
} | |
SubShader { | |
Tags { "RenderType"="Opaque" } |
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
using System; | |
using System.IO; | |
class Program { | |
static void Main(string[] args) { | |
Console.WriteLine("Close this window when you are finished doing cool progress"); | |
Console.WriteLine("first argument: path to Library folder"); | |
// Path | |
string path = new FileInfo(System.Reflection.Assembly.GetEntryAssembly().Location).Directory.FullName; |
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
// callback takes one argument | |
// http://stackoverflow.com/questions/8567114/how-to-make-an-ajax-call-without-jquery | |
// data = null or undefined para usar GET | |
AJAX = function(url, data, callbackOK, callbackFAIL, timeout) { | |
if (callbackFAIL === undefined) callbackFAIL = function(x){}; | |
if (callbackOK === undefined) callbackOK = function(x){}; | |
if (isNaN(timeout)) timeout = 30000; | |
var isPost = data !== undefined && data !== null; | |
var x = new XMLHttpRequest(); | |
if (isPost) x.open('POST', url, true); |
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
using System; | |
using System.Runtime.InteropServices; | |
namespace Ashkatchap.BitUtils { | |
public enum Endianness { | |
/// <summary> | |
/// Network Byte order | |
/// </summary> | |
Big = 0, | |
/// <summary> |
OlderNewer