This file contains 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
const THREE = require('three'); | |
function AjaxTextureLoader() { | |
/** | |
* Three's texture loader doesn't support onProgress events, because it uses image tags under the hood. | |
* | |
* A simple workaround is to AJAX the file into the cache with a FileLoader, then extract that into a | |
* texture with a separate TextureLoader call. | |
*/ |
This file contains 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 | |
$apiKey = "apikey"; | |
$secretKey = "secretkey"; | |
// Generates a random string of ten digits | |
$salt = mt_rand(); | |
// Computes the signature by hashing the salt with the secret key as the key |
This file contains 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 test() { | |
$sql = "INSERT INTO `table` (`id`, `name`) VALUES (?,?),(?,?) ON DUPLICATE KEY UPDATE `name` = VALUES(`name`) "; | |
$values = array(1, "test", 2, "so so"); | |
$stmt = $this->db->prepare($sql); | |
$stmt->execute($values); | |
} |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Page Title</title> | |
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> | |
<!-- Download from http://mediaelementjs.com/ We only need the build folder --> | |
<script src="build/mediaelement-and-player.min.js" type="text/javascript" charset="utf-8"></script> | |
<link rel="stylesheet" href="build/mediaelementplayer.min.css" type="text/css" media="screen" charset="utf-8"> |
This file contains 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
package test; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
import java.nio.channels.NonWritableChannelException; | |
import javax.xml.parsers.DocumentBuilder; | |
import javax.xml.parsers.DocumentBuilderFactory; | |
import javax.xml.parsers.ParserConfigurationException; |
This file contains 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 | |
// require 'path/to/vendor/autoload.php'; | |
use Assetic\Asset\FileAsset; | |
$asset = new FileAsset('path/to/file.js'); | |
header('Content-Type: application/javasript'); | |
echo $asset->dump(); |
This file contains 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 | |
namespace app\extensions\helper; | |
use Assetic\AssetWriter; | |
use Assetic\AssetManager; | |
use Assetic\FilterManager; | |
use Assetic\Asset\AssetCache; | |
use Assetic\Asset\AssetCollection; | |
use Assetic\Asset\FileAsset; |
This file contains 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
app.directive('errSrc', function() { | |
return { | |
link: function(scope, element, attrs) { | |
scope.$watch(function() { | |
return attrs['ngSrc']; | |
}, function (value) { | |
if (!value) { | |
element.attr('src', attrs.errSrc); | |
} |
This file contains 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
/* | |
:: Enhanced Version @extralam :: | |
Allows for ajax requests to be run synchronously in a queue , remove queue | |
Usage:: | |
var queue = new $.AjaxQueue(); | |
// add with tag name or not , both ok | |
queue.add('test',{ | |
url: 'url', |
This file contains 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($) { | |
$.Gridster.generate_stylesheet = function(opts) { | |
var styles = ''; | |
var max_size_x = this.options.max_size_x; | |
var max_rows = 0; | |
var max_cols = 0; | |
var i; | |
var rules; | |
opts || (opts = {}); |
NewerOlder