Skip to content

Instantly share code, notes, and snippets.

View atakurt's full-sized avatar

İsmail Ata Kurt atakurt

View GitHub Profile
@atakurt
atakurt / SquareSubMatrix.java
Last active December 18, 2021 16:44
Maximum size square sub-matrix with all 1s
package com.company;
public class SquareSubMatrix {
public static void main(String[] args) {
byte[][] matrix = new byte[][] {{0,1,1,0,1},
{1,1,0,1,0},
{0,1,1,1,0},
{0,1,1,1,0},
{1,1,1,1,1},
sudo vim /usr/share/applications/intellij.desktop
[Desktop Entry]
Version=2017.2
Type=Application
Terminal=false
Icon[en_US]=/home/ata/Downloads/idea-IU-172.4343.14/bin/idea.png
Name[en_US]=IntelliJ
Exec=/usr/local/bin/idea
Name=IntelliJ
gsettings set org.gnome.desktop.wm.preferences button-layout ":minimize,maximize,close"
@atakurt
atakurt / gist:8961434
Last active August 29, 2015 13:56
Convert List of Objects to List of Enums
public static <T extends Enum<T>> List<T> getEnumList(List<Object> values, Class<T> cls)
{
List<T> results = new ArrayList<T>();
for(Object o : values )
{
results.add(Enum.valueOf(cls, o.toString()));
}
return results;
}
@atakurt
atakurt / gist:8002449
Last active December 31, 2015 14:49
Syntax check added modified php files on git
for i in $(git diff --diff-filter=ACMRTUXB --name-status master | grep "\.php" | cut -c3-);do php -l $i;done
@atakurt
atakurt / gist:7915893
Created December 11, 2013 18:34
Tomcat open file descriptor count
echo $(lsof -p $(ps -ef | grep -m1 tomcat-juli | awk '{ print $2 }')| grep "TCP localhost" | wc -l)