Skip to content

Instantly share code, notes, and snippets.

View coolbung's full-sized avatar

Ashwin Date coolbung

View GitHub Profile
@coolbung
coolbung / Dockerfile
Created February 9, 2022 02:47 — forked from nzvtrk/Dockerfile
Nest.js multi-stage build dockerfile + docker-compose with postgres & migrations
FROM node:12.14.1-alpine AS build
# If you have troubles with node-gyp use should install these dependencies
RUN apk add g++ make python
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . ./
# build js & remove devDependencies from node_modules
//!/usr/bin/env groovy
// Get / Set release name
// TODO - remove hardcoded value
def version = '2.3.3' //env.getProperty("version")
echo version
pipeline {
agent any
stages {
@coolbung
coolbung / enrolledcoursessimple.php
Created September 11, 2018 09:37
Enrolled Courses Data Source
<?php
/**
* @package Shika
* @author TechJoomla | <[email protected]>
* @copyright Copyright (C) 2005 - 2014. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* Shika is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
@import url(https://fonts.googleapis.com/css?family=Roboto:400,700,500,300);@import url(https://fonts.googleapis.com/css?family=Roboto+Mono:400,700,500,300);@keyframes a{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes b{0%{opacity:1}50%{opacity:0}to{opacity:1}}[src$="blue.png"]{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDA5Njg4IiBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptLTIgMTVsLTUtNSAxLjQxLTEuNDFMMTAgMTQuMTdsNy41OS03LjU5TDE5IDhsLTkgOXoiLz48L3N2Zz4=)}[src$="red.png"]{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjRjQ0MzM2IiBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptMSAxNWgtMnYtMmgydjJ6bTAtNGgtMlY3aDJ2NnoiLz48L3N2Zz4=)}[src$="yellow.png
#!/usr/bin/env bash
#* @package Component Name
#* @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
# This Script can be used to maintain your demos and refresh them periodically
# It can also be used to create replication instances quickly for development and sync them with live or the other way round
# Another use of the script is for code deployments from local to live
# Currently this is for Joomla but you could potentially fork it for any database of file based application
# Fair Warning : Note that you are playing with your live server files and Database. So make sure you know what you are doing !
@coolbung
coolbung / test.php
Created May 27, 2016 16:14
Loading JForm field programatically
<?php
// No direct access
defined('_JEXEC') or die;
//Get custom field
JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
$media_dummy = JFormHelper::loadFieldType('MediaUpload');
$element_init = simplexml_load_string('<field name="dummy" type="mediaupload" mediaType="image" required="true"
accept="image/*" initCode="true" />');
$media_dummy->setup($element_init, '');
@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>
@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 / 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 / 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"