Skip to content

Instantly share code, notes, and snippets.

View the94air's full-sized avatar
🐞
Looking for bugs. Pushing fixes.

Abdalla Arbab the94air

🐞
Looking for bugs. Pushing fixes.
View GitHub Profile
<?php
/**
* Description of VideoStream
*
* @author Rana
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial
*/
class VideoStream
{
private $path = "";
@nakigao
nakigao / Model.php
Created June 10, 2015 03:11
Sample:PDO - model class
<?php
namespace Nakigao\Model;
class ModelBase
{
/**
* @var \PDO
*/
private $__pdo;
/**
@permatis
permatis / app.php
Created April 27, 2015 05:18
Create setting SwiftMailer in Slim Framework.
$app->mailer = function () {
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', '465', 'ssl')
->setUsername('[email protected]')
->setPassword('password');
$mailer = Swift_Mailer::newInstance($transport);
return $mailer;
};
@petehouston
petehouston / sync.sh
Created February 19, 2015 06:52
Little script to sync the project/public/ and www/ directory for Laravel 5 deployment
#!/bin/sh
mv www/index.php index.php.saved
rm -rf www/*
# update project/ to your directory name
cp -a project/public/* www
cp project/public/.* www
rm -rf www/index.php
mv index.php.saved www/index.php
@josephabrahams
josephabrahams / socialSharePopups.js
Last active November 29, 2021 19:39
Facebook & Twitter Share Popup Windows
(function($) {
$('.js-share-twitter-link').click(function(e) {
e.preventDefault();
var href = $(this).attr('href');
window.open(href, "Twitter", "height=285,width=550,resizable=1");
});
$('.js-share-facebook-link').click(function(e) {
e.preventDefault();
var href = $(this).attr('href');
window.open(href, "Facebook", "height=269,width=550,resizable=1");
@patrickgilmour
patrickgilmour / woocommerce-simple-or-variable.php
Created June 27, 2014 17:57
WooCommerce conditional to test if a Product is Simple or Variable.
<?php
/**
* Is a WooCommerce Product Simple or Variable
*
* see http://wordpress.org/support/topic/condition-to-check-if-product-is-simple-or-variable
*/
if( $product->is_type( 'simple' ) ){
// a simple product
alert('hello ' + document.location.href);
@claudiosanches
claudiosanches / django-runserver-ssl.md
Last active August 10, 2024 06:42
Django - SSL with runserver

Instalation

[sudo] apt-get install stunnel

Configuration

cd path/to/django/project
@tobysteward
tobysteward / BlogController.php
Last active January 2, 2025 07:28
Laravel AJAX Pagination with JQuery
<?php
class BlogController extends Controller
{
/**
* Posts
*
* @return void
*/
public function showPosts()
@sambody
sambody / tooltip with arrow down
Created June 29, 2013 21:50
CSS: arrow down on tooltip with border
/*
check in IE, might need ":" instead of "::"
HTML: <p class="tooltip">Some text</p>
*/
/* tooltip element with border */
.tooltip {
position:relative;
padding:15px;
margin:1em 0 3em;