One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
| <?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. |
| //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) { |
| 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 */ |
| /** | |
| * Mass (bulk) insert or update on duplicate for Laravel 4/5 | |
| * | |
| * insertOrUpdate([ | |
| * ['id'=>1,'value'=>10], | |
| * ['id'=>2,'value'=>60] | |
| * ]); | |
| * | |
| * | |
| * @param array $rows |
| var async = require('async'); | |
| var GitHubApi = require('github'); | |
| var github = new GitHubApi({ | |
| version: '3.0.0', | |
| protocol: 'https' | |
| }); | |
| github.authenticate({ | |
| type: 'basic', |
| /* | |
| * Handling Errors using async/await | |
| * Has to be used inside an async function | |
| */ | |
| try { | |
| const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
| // Success 🎉 | |
| console.log(response); | |
| } catch (error) { | |
| // Error 😨 |
| const waitFor = (ms) => new Promise(r => setTimeout(r, ms)) | |
| const asyncForEach = async (array, callback) => { | |
| for (let index = 0; index < array.length; index++) { | |
| await callback(array[index], index, array) | |
| } | |
| } | |
| const start = async () => { | |
| await asyncForEach([1, 2, 3], async (num) => { | |
| await waitFor(50) |
| <?php | |
| namespace App\Providers; | |
| use Illuminate\Support\ServiceProvider; | |
| use Twilio\Rest\Client; | |
| class TwilioServiceProvider extends ServiceProvider | |
| { | |
| public function register() |