Skip to content

Instantly share code, notes, and snippets.

View mickeypash's full-sized avatar
🐢
slow and steady wins the race

Mickey Pashov mickeypash

🐢
slow and steady wins the race
View GitHub Profile
@mickeypash
mickeypash / aliases.sh
Created February 26, 2015 20:13
separating out my aliases from my .profile
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
@mickeypash
mickeypash / slug.md
Last active August 29, 2015 14:15
what is a slug

slug A short label for something, containing only letters, numbers, underscores or hyphens. They’re generally used in URLs. For example, in a typical blog entry URL:

https://www.djangoproject.com/weblog/2008/apr/12/spring/

the last bit (spring) is the slug.

@mickeypash
mickeypash / stack-trace.java
Created February 10, 2015 20:32
problem with removing Referees
Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 5, Size: 5
at java.util.ArrayList.rangeCheck(ArrayList.java:653)
at java.util.ArrayList.get(ArrayList.java:429)
at JavaBallController$RefereeTableModel.getValueAt(JavaBallController.java:374)
at javax.swing.JTable.getValueAt(JTable.java:2717)
at javax.swing.JTable.prepareRenderer(JTable.java:5706)
at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2114)
at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:2016)
at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1812)
at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161)
@mickeypash
mickeypash / writeFileBytesBuffered.java
Created February 5, 2015 21:37
Buffered writer in Java
void writeFileBytesBuffered(String filename, String content) {
try {
BufferedWriter writer =
Files.newBufferedWriter(
FileSystems.getDefault().getPath(".", filename),
Charset.forName("US-ASCII"),
StandardOpenOption.CREATE);
writer.write(content, 0, content.length());
}
@mickeypash
mickeypash / histp
Created January 30, 2015 19:03
Self explanatory
#!/bin/sh
#
# Displays your top 10 most used commands
#
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10
@mickeypash
mickeypash / JavaC.sublime-build
Created January 26, 2015 20:02
Run and Compile Java from SublimeText 2
{
"cmd": ["javac", "-Xlint", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.java",
"variants": [
{ "cmd": ["javac", "-Xlint", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.java",
@mickeypash
mickeypash / tut13-q4
Created December 9, 2014 11:22
Programming Tutorial 13 Question 4
import java.x.swing *;
import java.awt *;
import java.awt.event *;
public Class ThreeColorsComboBox extends JFrame implements ActionListener{
private JComboBox colorCombo;
private JPanel colorPanel;
public ThreeColorsComboBox () {
@mickeypash
mickeypash / I am dying
Created March 9, 2014 19:00
ggplot is so difficult for me
library(ggplot2)
gg.means <- data.frame(PComp=mean(prop.mean$PComp), SComp=mean(prop.mean$SComp), Unrl=mean(prop.mean$Unrl))
ggplot(melt(gg.means,id.var=c()), aes(x=,y=Value)) + geom_bar()
@mickeypash
mickeypash / Barplots
Created March 9, 2014 18:43
I need to add errobars to this plot and maybe make a transformation or use something other than barplots to visualise these means
b.means <-c (0.2356355, 0.2294562, 0.2197686)
barplot(b.means,ylim=c(0,1), main="Mean proportion for competitors",
names.arg= c("Phonological", "Semantic", "Distractor"), col = c("gray1", "gray45", "gray90"))
############ Shapiro test #################
########### normality #####################
> shapiro.test(prop.mean$PComp)
Shapiro-Wilk normality test
data: prop.mean$PComp
W = 0.9662, p-value = 0.528