Skip to content

Instantly share code, notes, and snippets.

View igorrendulic's full-sized avatar

Igor Rendulic igorrendulic

View GitHub Profile
@igorrendulic
igorrendulic / MailgunWebhook.java
Last active December 3, 2017 22:19
MailGun Webhook Handler
public class MailgunWebhook extends HttpServlet {
private static final long serialVersionUID = 1L;
public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
try {
resp.setContentType("application/json");
String token = null;
@igorrendulic
igorrendulic / iosscroll.css
Last active August 25, 2017 18:51
Momentum Scrolling on iOS Overflow Elements
body {
padding: 20px;
}
div {
width: 200px;
height: 200px;
margin-right: 20px;
overflow-y: scroll; /* has to be scroll, not auto */
float: left;
@igorrendulic
igorrendulic / FindSubarrayInArray.java
Last active April 19, 2017 17:24
Find number of times subarray repeats in an array
/**
* Finding number of times subarray repeats in array <br>
* @param array must be >= @param subarray
* @return # of subarray repeats or 0
*/
public int findSubarrayCount(List<String> array, List<String> subarray, int fromIndex) {
int cntTotal = 0;
String firstElement = null;
if (subarray.size() > 0) {
@igorrendulic
igorrendulic / ISO-3166-Countries-with-Regional-Codes.json
Created March 23, 2017 09:11
ISO 3166 Countries with Regional Codes JSON
{
"BD": {
"alpha_2": "BD",
"name": "Bangladesh"
},
"BE": {
"alpha_2": "BE",
"name": "Belgium"
},
"BF": {
@igorrendulic
igorrendulic / .gitignore
Created March 11, 2017 21:56
gitignore java maven eclipse intellij
# Eclipse
.classpath
.project
.settings/
# Intellij
.idea/
*.iml
*.iws
@igorrendulic
igorrendulic / Nginx reverse proxy config for Tomcat7 on Debian
Last active June 21, 2016 18:32
Nginx reverse proxy config for Tomcat7 on Debian and 413 File too Large problem
Tomcat7 add to config:
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context path="" docBase="administracija">
<WatchedResource>WEB-INF/web.xml</WatchedResource>
</Context>
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->