Skip to content

Instantly share code, notes, and snippets.

update smart_navigation_custom_layouts
set icon =
(SELECT icon.*
FROM OPENROWSET
(BULK 'c:\development\images\ad-right-3x2.png', SINGLE_BLOB) icon),
icon_type = N'PNG'
where smart_navigation_custom_layout_oid = 1
// Karma configuration
// Generated on Wed Feb 04 2015 22:00:05 GMT-0800 (PST)
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// Karma configuration
// Generated on Wed Feb 04 2015 22:00:05 GMT-0800 (PST)
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ZoomSystems</groupId>
<artifactId>ZoomSystems</artifactId>
<name>ZoomSystems</name>
<version>6.6</version>
<packaging>war</packaging>
<build>
@krishnagists
krishnagists / unittest_template.py
Last active June 15, 2017 18:36
python unittest template
import unittest
class FooTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
pass
@classmethod
def tearDownClass(cls):
export MAVEN_OPTS='-Xmx512m -XX:MaxPermSize=128m -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9002'
export REBEL_BASE="/Users/krishna/.jrebel"
export MAVEN_OPTS="-javaagent:/Users/krishna/bin/jrebel.jar $MAVEN_OPTS"
ant init-tests
ant release-ecenter
ant init-tests
> logs/ecenter.log
mvn -f tomcat.pom.xml -P ecenter tomcat6:run -o
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ZoomSystems</groupId>
<artifactId>ZoomSystems</artifactId>
<name>ZoomSystems</name>
<version>6.6</version>
<packaging>war</packaging>
@krishnagists
krishnagists / MockRestServiceServerTest.java
Created June 16, 2015 20:03
spring mvc mock-rest-template-service
package com.spring.test;
import org.junit.Test;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.http.client.ClientHttpRequest;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.mock.http.client.MockClientHttpResponse;
@krishnagists
krishnagists / shell_call.py
Last active August 29, 2015 14:23
python call shell command
from subprocess import call
from subprocess import check_output
# call([cmd], shell=True)
# example: calling sed to change text in a jsp
call(["sed -i '' 's/var sessionId = \".*\"/var sessionId = \"%s\"/g' %s" % (session_id, view_jsp)], shell=True)
# check_output: to get the output of the program
out = check_output(["echo hello"], shell=True)
@krishnagists
krishnagists / cp-api-find-ad-show-image.js
Created June 19, 2015 21:16
cp api find ad and show image
<script>
$(function() {
api.cp.findAds({}, function(err, ads) {
if(ads.length > 0) {
$('#ad-holder img').attr('src', ads.at(0).image());
}
});
});
</script>