Skip to content

Instantly share code, notes, and snippets.

View ashutoshdev-zz's full-sized avatar

Ashutosh Kumar ashutoshdev-zz

View GitHub Profile
#
# Verify captcha
$post_data = http_build_query(
array(
'secret' => CAPTCHA_SECRET,
'response' => $_POST['g-recaptcha-response'],
'remoteip' => $_SERVER['REMOTE_ADDR']
)
);
$opts = array('http' =>
@ashutoshdev-zz
ashutoshdev-zz / gist:1b2ac22e161ce079853bb6c03a74c788
Created February 1, 2017 13:14 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@ashutoshdev-zz
ashutoshdev-zz / README.md
Created December 5, 2016 13:21 — forked from tarto-dev/README.md
Push notifications IONIC (APNS + GCM) + PHP Sender

Pour faire fonctionner les pushs sur Android / iOS, il faut ajouter ce plugin

cordova plugin add phonegap-plugin-push --variable SENDER_ID="xxxxxx

Le code dans app.js est à placer dans les directives appropriés, le fichier push.php permet de tester les pushs sur APNS & GCM

@ashutoshdev-zz
ashutoshdev-zz / stream_to_youtube.sh
Created August 31, 2016 06:40 — forked from olasd/stream_to_youtube.sh
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
<html>
<head>
<title>Google Maps Multiple Markers</title>
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
</head>
<body>
<div id="map" style="height: 400px; width: 500px;">
</div>
<script type="text/javascript">
<?php
/* Cakephp 2
* Login with email or username
* Link: http://www.netboy.pl/2011/08/cakephp-auth-component-login-with-username-or-e-mail/#comment-9560
*/
public function login() {
if($this->request->is('post')) {
App::Import('Utility', 'Validation');
if( isset($this->data['User']['username']) &&
<?php
/* Cakephp 2
* Login with email or username
* Link: http://www.netboy.pl/2011/08/cakephp-auth-component-login-with-username-or-e-mail/#comment-9560
*/
public function login() {
if($this->request->is('post')) {
App::Import('Utility', 'Validation');
if( isset($this->data['User']['username']) &&
<?php
/**
* Plugin Name: WooCommerce - List Products by Attributes
* Plugin URI: http://www.remicorson.com/list-woocommerce-products-by-attributes/
* Description: List WooCommerce products by attributes using a shortcode, ex: [woo_products_by_attributes attribute="colour" values="red,black" per_page="5"]
* Version: 1.0
* Author: Remi Corson
* Author URI: http://remicorson.com
* Requires at least: 3.5
* Tested up to: 3.5