Skip to content

Instantly share code, notes, and snippets.

View yasakbulut's full-sized avatar
:shipit:

Yasa Akbulut yasakbulut

:shipit:
View GitHub Profile

Keybase proof

I hereby claim:

  • I am yasakbulut on github.
  • I am yasakbulut (https://keybase.io/yasakbulut) on keybase.
  • I have a public key ASBh2J4_XtOwTWC-rv8gL3sqET0421KNmdOFHR6LI1mXBgo

To claim this, I am signing this object:

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h1>Add new blog post</h1>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Blog - Login</title>
</head>
<body>
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="pUnit">
<jta-data-source>TEST_JNDI</jta-data-source>
<properties>
<property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
</properties>
</persistence-unit>
</persistence>
git config --global alias.lg 'log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative'
@yasakbulut
yasakbulut / getAvgResponseTimeForURL
Created January 14, 2014 07:18
Calculates the average response time (in milliseconds) for requests made to an URL containing a specified keyword, given an object containing HAR (Http ARchive) data.
function getAvgResponseTimeForURL(har, keyword){
har.log.entries.filter(function(a){return a.request.url.indexOf(keyword)!=-1}).map(function(a){ return a.time}).reduce(function(previousValue, currentValue, index, array){return previousValue + (currentValue / array.length);},0);
}
@yasakbulut
yasakbulut / example-user.js
Created June 7, 2012 10:28 — forked from nijikokun/example-user.js
Beautiful Validation... Why have I never thought of this before?!
var user = {
validateCredentials: function (username, password) {
return (
(!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' }
: (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' }
: (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' }
: (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' }
: (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' }
: false
);
@yasakbulut
yasakbulut / tree.md
Created June 7, 2012 09:47 — forked from hrldcpr/tree.md
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@yasakbulut
yasakbulut / gist:2595142
Created May 4, 2012 14:34
HTML: file input styling #dirtyhack
div.fileinputs {
position: relative;
}
div.fakefile {
position: absolute;
top: 0px;
left: 0px;
z-index: 1;
}