Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I'd rather be here and now.

ender eaorak

💭
I'd rather be here and now.
View GitHub Profile
@eaorak
eaorak / gist:1ac27dd38809acdcc17d
Created Jan 10, 2016 — forked from sgergely/gist:3793166
Midnight Commander Keyboard Shortcuts for Mac OSX
View gist:1ac27dd38809acdcc17d
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@eaorak
eaorak / PerformanceRelated.txt
Last active Dec 6, 2015 — forked from neomatrix369/PerformanceRelated.md
Interesting links in the areas of HPC, low latency, mechanical harmony/sympathy, garbage collection
View PerformanceRelated.txt
Everything I Ever Learned About JVM Performance Tuning @Twitter- by Attila Szegedi
http://www.infoq.com/presentations/JVM-Performance-Tuning-twitter (video & slides)
9 Fallacies of Java Performance - by Ben Evans
http://www.infoq.com/articles/9_Fallacies_Java_Performance (video & slides)
Visualizing Java GC - by Ben Evans
http://www.infoq.com/presentations/Visualizing-Java-GC (video & slides)
@eaorak
eaorak / Size
Created Jan 16, 2014
Useful enum for file size calculations.
View Size
/**
* Useful for disk file size calculations. [eaorak]
*/
public enum Size {
BY, // Bytes
KB, // Kilo
MB, // Mega
GB, // Giga
TB, // Tera
@eaorak
eaorak / InfoShortener.java
Last active Dec 14, 2015
Information shortener, can be used for shorten info like urls.
View InfoShortener.java
/**
* Abstract generic info shortener that can be modified
* to generate short ids for desired classes.
*
* @author eaorak
*/
public abstract class InfoShortener<T> {
private static int ALPCNT = 62;
private static String cstr = new String();
@eaorak
eaorak / RoundArray.java
Created Oct 31, 2012
Java - RoundArray<T>
View RoundArray.java
package us.elron.utils.cache;
import java.lang.reflect.Array;
import java.util.Arrays;
/*
RoundArray can hold a "window" of values, oldest values are removed from
the array when new ones are added. It also supports console based simple
visualization.
*/
@eaorak
eaorak / hangman.py
Created Oct 31, 2012
Python - Hangman Game
View hangman.py
#!/usr/bin/python3
# Hangman game
import random
class HangMan(object):
# Hangman game
hang = []
hang.append(' +---+')
@eaorak
eaorak / caesar_cipher.py
Created Oct 30, 2012
Python - Caesar Cipher
View caesar_cipher.py
#!/usr/bin/python3
# Caesar Cipher
LEN,UP_MIN,LOW_MIN = 26,65,97
def getchar(ch, key, enc):
if not ch.isalpha():
return ch
key = key if enc else -key
(min,max) = (UP_MIN, UP_MIN+LEN) if ch.isupper() else (LOW_MIN, LOW_MIN+LEN)
@eaorak
eaorak / tictactoe.py
Created Oct 27, 2012
Python - TicTacToe Game
View tictactoe.py
#!/usr/bin/python3
# Simple TicTacToe game in Python - EAO
import random
import sys
board=[i for i in range(0,9)]
player, computer = '',''
# Corners, Center and Others, respectively
moves=((1,7,3,9),(5,),(2,4,6,8))
@eaorak
eaorak / sss.py
Created Oct 11, 2012
Python - Screen Saver "Saver" Script
View sss.py
#!/usr/bin/python
# This script prevents screen saver get activated by moving mouse periodically.
# EAO-09.2012
import win32api, time
print "Die screensaver !"
dif=1
exc=False
while True:
try:
@eaorak
eaorak / tureng.py
Last active Nov 23, 2015
Python - Console Dictionary for tureng.com
View tureng.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Basic dictionary script that parses results from tureng.com - EAO
import sys
import urllib2
from BeautifulSoup import BeautifulSoup
try: