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
//searchText is a input type text | |
$('#searchText').bind('keyup', function() { | |
var searchString = $(this).val(); | |
$("ul li").each(function(index, value) { | |
currentName = $(value).text() | |
if( currentName.toUpperCase().indexOf(searchString.toUpperCase()) > -1) { |
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 | |
// Define a 32-byte (64 character) hexadecimal encryption key | |
// Note: The same encryption key used to encrypt the data must be used to decrypt the data | |
define('ENCRYPTION_KEY', 'd0a7e7997b6d5fcd55f4b5c32611b87cd923e88837b63bf2941ef819dc8ca282'); | |
// Encrypt Function | |
function mc_encrypt($encrypt, $key){ | |
$encrypt = serialize($encrypt); | |
$iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC), MCRYPT_DEV_URANDOM); | |
$key = pack('H*', $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
<?php | |
//Get data from instagram api | |
$hashtag = 'max'; | |
//Query need client_id or access_token | |
$query = array( | |
'client_id' => '', | |
'count' => 3 | |
); | |
$url = 'https://api.instagram.com/v1/tags/'.$hashtag.'/media/recent?'.http_build_query($query); |
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 | |
class FacebookDebugger | |
{ | |
/* | |
* https://developers.facebook.com/docs/opengraph/using-objects | |
* | |
* Updating Objects | |
* | |
* When an action is published, or a Like button pointing to the object clicked, | |
* Facebook will 'scrape' the HTML page of the object and read the meta tags. |
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
#!/bin/bash | |
# | |
# Use this script to perform backups of one or more MySQL databases. | |
# | |
# Databases that you wish to be backed up by this script. You can have any number of databases specified; encapsilate each database name in single quotes and separate each database name by a space. | |
# | |
# Example: | |
# databases=( '__DATABASE_1__' '__DATABASE_2__' ) |
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 | |
/** | |
* Dump helper. Functions to dump variables to the screen, in a nicley formatted manner. | |
* @author Joost van Veen | |
* @version 1.0 | |
*/ | |
if (!function_exists('dump')) { | |
function dump ($var, $label = 'Dump', $echo = TRUE) | |
{ | |
// Store dump in variable |
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
User.aggregate([ | |
{ | |
/* Filter out users who have not yet subscribed */ | |
$match: { | |
/* "joined" is an ISODate field */ | |
'subscription.joined': {$ne: null} | |
} | |
}, | |
{ | |
/* group by year and month of the subscription event */ |
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> | |
<title>iOS6 Safari Photo Capture Demo</title> | |
<script type="text/javascript"> | |
window.onload = function() { | |
var input = document.getElementById("input"); | |
input.addEventListener("change", handleFile); | |
} |
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\Providers; | |
use Illuminate\Support\ServiceProvider; | |
use Twilio\Rest\Client as TwilioService; | |
class TwilioServiceProvider extends ServiceProvider | |
{ | |
public function register() |
NewerOlder