Skip to content

Instantly share code, notes, and snippets.

@kvahuja
kvahuja / content-pom.xml
Last active August 29, 2015 14:05
Stores the list of dependencies that you would need to make your project compile is you are using the JSPc compile plugin for AEM development with the latest release of AEM Eclipse Plugin
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.jcr.jcr-wrapper</artifactId>
<!-- javax.jcr -->
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.api</artifactId>
</dependency>
<dependency>
@kvahuja
kvahuja / index.html
Created August 21, 2014 03:44
JQuery bxslider Carousel Wrapper HTML
<!doctype html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<head>
<title>bxSlider</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
@kvahuja
kvahuja / common-cq-incluces
Created September 1, 2014 13:00
Set of files that almost needs to be included in all the components and templates developed in CQ.
<%@include file="/libs/foundation/global.jsp"%>
<cq:include script="init.jsp"/>
@Aspect
public class ProfilingAspect {
@Around("methodsToBeProfiled()")
public Object profile(ProceedingJoinPoint pjp) throws Throwable {
StopWatch sw = new StopWatch(getClass().getSimpleName());
try {
sw.start(pjp.getSignature().getName());
return pjp.proceed();
} finally {
@kvahuja
kvahuja / scp-upload-file.sh
Last active February 7, 2017 04:57
Shell Cheat Sheet
scp -i folder/where/private/key/is/placed/key-name.ppk -r source/folder/in/local.machine/* username@host:/folder/in/remote/machine/
@kvahuja
kvahuja / Select all occurences of a text
Created February 7, 2017 06:03
Sublime Key Mappings
Alt+F3
@kvahuja
kvahuja / pg_dump.sh
Created February 10, 2017 05:07
PgSQL Commands
# how to generate a dump for postgres
pg_dump --file "dmp.filename.ext" --host "hostname" --port "5432" --username "myusername" --password "changeme" --verbose --role "dbname" --format=c
@kvahuja
kvahuja / Info.php
Created February 27, 2017 04:47
Check PHP Installation
<?php
phpinfo();
?>
@kvahuja
kvahuja / db-connect-check.php
Created February 27, 2017 04:53
PHP DB Connect Check
<?php
# To run this script use the following command on cli (we assume you have all dependencies installed)
# only checks for mysql for now
# $ php -f db-connect-check.php
$dbhost = 'host';
$dbport = '3306'
$dbname = 'name';
$dbuser = 'user';
$dbpass = 'pass';
@kvahuja
kvahuja / Heros.php
Last active April 1, 2017 09:34
Vainglory API - Mappings
<?php
return [
'*Adagio*' => 'Adagio',
'*Alpha*' => 'Alpha',
'*Ardan*' => 'Ardan',
'*Baron*' => 'Baron',
'*Blackfeather*' => 'Blackfeather',
'*Catherine*' => 'Catherine',