Skip to content

Instantly share code, notes, and snippets.

View coolbung's full-sized avatar

Ashwin Date coolbung

View GitHub Profile
#!/usr/bin/env bash
# Remote Server - This is where you keep a clean copy of your demo
# Local server - The server local to this script. This is where your publicly accessible demo resides.
# Remote server connection
REMOTE_PORT=2022
REMOTE_SERVER=subzero.com
REMOTE_USER=subzero
REMOTE_PATH=/home/subzero/httpdocs/demos/js25
@coolbung
coolbung / ats-cpanel-default.php
Created November 18, 2014 06:31
Jump to ticket on CPanel
<?php
/**
* @package ats
* @copyright Copyright (c)2011-2014 Nicholas K. Dionysopoulos / AkeebaBackup.com
* @license GNU GPL v3 or later
*/
// No direct access
defined('_JEXEC') or die;
@coolbung
coolbung / gist:14103ef2d6ff0fa8254a
Created December 20, 2014 07:54
Redmine Reply by email rake settings
rake -f /srv/redmine/Rakefile redmine:email:receive_imap RAILS_ENV="production" host=imap.gmail.com username=user@foo.bar password=XXXX ssl=1 port=993
@coolbung
coolbung / gist:47e439599e259cc2088d
Created January 3, 2015 13:01
Starter htaccess for caching and security
### ===========================================================================
### Security Enhanced & Highly Optimized .htaccess File for Joomla!
### automatically generated by Admin Tools 3.1.1 on 2014-10-17 14:40:12 GMT
### Auto-detected Apache version: 2.5 (best guess)
### ===========================================================================
###
### The contents of this file are based on the same author's work "Master
### .htaccess", published on http://snipt.net/nikosdion/the-master-htaccess
###
### Admin Tools is Free Software, distributed under the terms of the GNU
@coolbung
coolbung / users.php
Created June 30, 2015 07:57
Version suport for com_api
<?php
/**
* @package API plugins
* @copyright Copyright (C) 2009 2014 Techjoomla, Tekdi Technologies Pvt. Ltd. All rights reserved.
* @license GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
* @link http://www.techjoomla.com
*/
defined('_JEXEC') or die( 'Restricted access' );
jimport('joomla.plugin.plugin');
class plgAPIUsers extends ApiPlugin
@coolbung
coolbung / gist:40e04f71fa268cb154f3
Last active February 10, 2016 16:25
Upload files using Joomla JHttp
$path = realpath('/absolute/path/to/file.jpg');
$upload_path = new \CURLFile($path);
$url = 'http://example.com/upload';
//$post_data['foo'] = 'bar';
$post_data['file'] = $upload_path;
//$headers['user-id'] = 'imli';
$headers['Content-Type'] = 'multipart/form-data';
@coolbung
coolbung / ttpl_install.sh
Last active March 24, 2017 07:18
Script to install typical tools needed by TTPL Devs
#!/bin/bash
read -p "Enter non-admin username (eg: ttpl1) : " non_admin_username
php71_name="${non_admin_username}-php71.local"
php7_name="${non_admin_username}-php7.local"
php5_name="${non_admin_username}-php5.local"
non_admin_home_dir="/home/${non_admin_username}"
if [ ! -d "$non_admin_home_dir" ]; then
echo "Invalid username"
@coolbung
coolbung / dashboard-summary-content.20160318.json
Created March 18, 2016 15:09
Daily Summary - Overall and Content-wise
{
"date" : "2016-03-18",
"content_summary" :
[
{
"content_id" : "content_3400",
"incremental_timespent" : 70000,
"incremental_sessions" : 340,
"average_timespent" : 340,
"average_interactions_minute" : 340,
@coolbung
coolbung / app.js
Created April 21, 2016 12:31
Push & Translation
var juniteApp = angular.module('junite', ['ngRoute', 'ngTouch', 'toaster', 'LocalStorageModule', 'junite-Service', 'junite-directives', 'juniteController', 'socialapp', 'pascalprecht.translate', 'loginController', 'loginService', 'lib-ui', 'textAngular', 'blogapp', 'jgive','ngCordova','ngTwitter','ngCordovaOauth']);
juniteApp.run(function ($rootScope, $location, localStorageService, $window, $route, toaster, checkConnection, $translate, juniteService) {
// Push custom app vars
$rootScope.is_custom = (custom_app.LOGINURL.length > 0);
$rootScope.custom_app = custom_app;
// $rootScope.messages = message;
$rootScope.fbConnect = false;
// Initialize loader object
$rootScope.loader = {
@coolbung
coolbung / albumphotos.html
Created April 21, 2016 15:19
Multiple Photo Upload
<div class="overlay ng-scope overlay-show" id="albumphots_dialog" toggleable="" parent-active-class="overlay-in" active-class="overlay-show">
<div class="navbar navbar-app navbar-absolute-top">
<div class="btn-group pull-left pullLeftWidthAlbum">
<div class="btn btn-navbar divOverflow" ng-hide="addPhotoDiv">
<span ng-click="toggleAction('albumphots_dialog');
title = 'albums'">
<i class="fa fa-chevron-left"></i>
{{ title | uppercase }}
</span>
</div>