This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// UTIL METHODS | |
/** | |
* Replaces arguments in error messages: "This {0} is an error for {1}", [a, b] => "This a is an error for b" | |
*/ | |
private error_message_replace_values(String error_msg, List values) | |
{ | |
for (int i = 0; i < values.size(); i++) | |
{ | |
error_msg = error_msg.replace("{$i}", values[i].toString()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"appId": "com.thatisuday.fileio", | |
"productName": "Electron File IO", | |
"copyright": "THATISUDAY TECH PVT. LTD.", | |
"directories": { | |
"app": ".", | |
"output": "out", | |
"buildResources": "build-res" | |
}, | |
"files": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Colors | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
NO_COLOR='\033[0m' | |
BLUE='\033[0;34m' | |
YELLOW='\033[0;33m' | |
NO_COLOR='\033[0m' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def objectInstance = Class.forName("NAME.AS.STRING").newInstance() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sample https://jsfiddle.net/ppazos/Lngbx0t9/5/ | |
Reference to the drawing API https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/beginPath | |
Better library https://github.com/anseki/leader-line | |
# HTML | |
<canvas id="canvas" width=300 height=300></canvas> | |
<div style="margin-left: 30px"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.grails.common.ApprovalStatus | |
import static org.grails.common.ApprovalStatus.* | |
class CommonTagLib { | |
static namespace = "common" | |
static final STATUS_TO_CSS_CLASS = [ | |
(PENDING): "warning", | |
(REJECTED): "important", | |
(APPROVED): "success" ].asImmutable() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// response transformer | |
logger.info("RESPONSE TRANSFORMER"); | |
logger.info(msg); | |
logger.info($('responseStatusLine')); | |
var statusLine = $('responseStatusLine'); | |
var parts = statusLine.split(' '); | |
if (parts.length >= 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env groovy | |
import org.eclipse.jetty.server.Server | |
import org.eclipse.jetty.servlet.* | |
import groovy.servlet.* | |
@Grab(group='org.eclipse.jetty.aggregate', module='jetty-all', version='7.6.15.v20140411') | |
def startJetty() { | |
def server = new Server(8080) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def a = [ | |
Double.class, | |
Date.class | |
] | |
a.each { clazz -> | |
if (clazz.equals(Double)) println clazz.toString() +" equals Double 1" // OK | |
if (clazz == Double) println clazz.toString() +" equals Double 2" // OK | |
if (Number.isAssignableFrom(clazz)) println clazz.toString() +" anumber 2" // OK: Number is the same or super class of clazz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$emp_payor = $EmployerPayor->findBy([ | |
'AND' => [ | |
['employer_id', '=', $employer->get_id()], | |
'OR' => [ | |
'AND' => [ | |
['valid_to', '>', $dos], | |
['valid_from', 'IS NULL'] | |
], |