Skip to content

Instantly share code, notes, and snippets.

View mlshvdv's full-sized avatar
🏠
Working from home

Dmitriy Malyshev mlshvdv

🏠
Working from home
  • World
View GitHub Profile
@mlshvdv
mlshvdv / mysql-get-dublicated.sql
Created March 24, 2014 09:24
Получить повторяющиеся записи в MySQL
SELECT `user_login`, count(*) as total FROM users GROUP BY `user_login` HAVING total > 1;
@mlshvdv
mlshvdv / GCM
Created October 22, 2013 09:27
<?php
/**
* @param apiKey - ключ для GCM, получить можно в https://code.google.com/apis/console/
* @param registrationIdsArray - массив токенов устройств
* @param messageData - массив данных уведомления, например: array('message' => "Hey!")
*/
function sendGCMNotification( $apiKey, $registrationIdsArray, $messageData )
{
$headers = array("Content-Type:" . "application/json", "Authorization:" . "key=" . $apiKey);
$data = array(