Skip to content

Instantly share code, notes, and snippets.

@aimtiaz11
aimtiaz11 / templating.groovy
Last active August 28, 2018 00:31
Groovy Templating
def binding = [
"id": "1",
"firstName": "John"
]
String substitute(text, map) {
def template = new groovy.text.StreamingTemplateEngine().createTemplate(text)
return template.make(map)
}
@aimtiaz11
aimtiaz11 / readme.txt
Created June 20, 2018 00:29
SQL - Fetching min/max per group
select f.type, f.variety, f.price
from (
select type, min(price) as minprice
from fruits group by type
) as x inner join fruits as f on f.type = x.type and f.price = x.minprice;
+--------+----------+-------+
| type | variety | price |
+--------+----------+-------+
@aimtiaz11
aimtiaz11 / readme.md
Last active May 5, 2018 09:08
API Request/Response Model
@aimtiaz11
aimtiaz11 / cheatsheet.md
Last active March 13, 2018 01:54
Vim Cheatsheet

Vim Cheatsheet

Cursor Position

File

  1. Move cursor to end of file: :$
  2. Move cursor to beginning of file: gg

Line

@aimtiaz11
aimtiaz11 / GenerateRequestTestDriver.java
Created February 16, 2018 03:17 — forked from rayedchan/GenerateRequestTestDriver.java
Generate requests using Oracle Identity Manager API
package com.blogspot.oraclestack.testdriver;
import com.blogspot.oraclestack.services.OracleIdentityManagerClient;
import com.blogspot.oraclestack.utilities.GenerateRequestUtilities;
import java.util.HashMap;
import oracle.iam.platform.OIMClient;
import oracle.iam.vo.OperationResult;
/**
* Test Driver for GenerateRequestUtilities class
@aimtiaz11
aimtiaz11 / delete-jobs.py
Last active October 1, 2019 18:01
Python script to delete jobs & nested views in Jenkins-CI
'''
Script to delete jobs and nested views in Jenkins CI including the parent view.
This currently works when you have two-level nested views with jobs under the child view.
Parent view
- Child view 1
- Job 1
- Job 2
- Child view 2
- Job 3
@aimtiaz11
aimtiaz11 / rest-api-php.md
Created October 9, 2017 06:08
REST API Resources

REST, RESTful, REST-like API Resources

Paper

Blog posts

@aimtiaz11
aimtiaz11 / slack_delete.py
Created September 20, 2017 09:59 — forked from jackcarter/slack_delete.py
Delete Slack files older than 30 days. Rewrite of https://gist.github.com/jamescmartinez/909401b19c0f779fc9c1
import requests
import time
import json
token = ''
#Delete files older than this:
ts_to = int(time.time()) - 30 * 24 * 60 * 60
def list_files():
@aimtiaz11
aimtiaz11 / ctrl.js
Created June 21, 2017 00:42
Kendo grid column template + Boostrap button dropdown
$scope.templateTypeGrid = {
columns: [
{
// Add each action item below
template: '<div class=\'btn-group\' uib-dropdown dropdown-append-to-body>' +
' <button id=\'btn-append-to-body\' type=\'button\' class=\'btn btn-primary\' uib-dropdown-toggle>Action' +
' <span class=\'caret\'></span>' +
' </button>' +
' <ul class=\'dropdown-menu\' uib-dropdown-menu role=\'menu\' aria-labelledby=\'btn-append-to-body\'>' +
@aimtiaz11
aimtiaz11 / readme.md
Last active December 11, 2017 18:18
Spring Data and Kendo Grid Datasource Pagination

Spring Data and Kendo Grid Datasource Pagination

How to implement Kendo Grid pagination and sorting with Spring Data.

Angular

Setup Kendo grid options as below in controller or directive

$scope.publishHistoryGridOptions = {