Skip to content

Instantly share code, notes, and snippets.

@jimlindstrom
jimlindstrom / plot-likert.r
Created November 30, 2011 03:36
Plotting Likert-scale data with R
# Inputs
feature_names <- c("Feature 5", "Feature 4", "Feature 3", "Feature 2", "Feature 1")
num_features <- length(feature_names)
y <- array(c(10,4,1,0, 3,4,2,0, 1,2,8,1, 0,0,5,1, 1,2,5,3), dim=c(4,num_features))
# Calculate plot
num_neg_ratings <- 0
num_pos_ratings <- 0
for(i in 1:num_features) {
num_neg_ratings = max(num_neg_ratings, sum(y[1:2,i]), sum(y[3:4,i]))
@rschumm
rschumm / machtcher.java
Created April 4, 2012 21:59
JUnit Matcher / Hamcrest
mit dem Matcher können komplexere Vergleiche mit "assertThat" getestet werden, hier ein einfaches Beispiel,
welches testet, dass zwei Daten am gleichen Tag sind.
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
...
@jkeam
jkeam / GroovyExcelParser.groovy
Created November 16, 2012 02:57
A groovy script to parse an excel document.
import org.apache.poi.ss.usermodel.*
import org.apache.poi.hssf.usermodel.*
import org.apache.poi.xssf.usermodel.*
import org.apache.poi.ss.util.*
import org.apache.poi.ss.usermodel.*
import java.io.*
class GroovyExcelParser {
//http://poi.apache.org/spreadsheet/quick-guide.html#Iterator
@uarun
uarun / intellij.md
Last active February 26, 2024 06:57
Intellij IDEA - Cheat Sheet (aka useful shortcuts)

Intellij IDEA - Cheat Sheet (aka most useful shortcuts)

Note: Some of these keymapping are specific to IdeaVim plugin. If you don't use IdeaVim (what' wrong with you :)), I've tried to point out where they differ, but I could have missed a few

Coding Session

Parameter documentation for Method Calls

  • Ctrl-P - Popup parameter documentation for method calls
@mharizanov
mharizanov / WiFiCheck
Created April 6, 2013 08:50
Script to check and re-connect WiFi on Raspberry Pi
#!/bin/bash
##################################################################
# A Project of TNET Services, Inc
#
# Title: WiFi_Check
# Author: Kevin Reed (Dweeber)
# dweeber.dweebs@gmail.com
# Project: Raspberry Pi Stuff
#
# Copyright: Copyright (c) 2012 Kevin Reed <kreed@tnet.com>
@hannic
hannic / shell_unlock-protected-pdf.md
Last active December 9, 2018 20:29
how to print password-protected pdf files with terminal (mac) #pdf #gs

How to unlock a protectd PDF

You have to get Ghostscript installed first. Run the script, that's it.

#!/bin/sh
# First, type the ghostscript line, second in GS env quit to generate the pdf 
# gs -sOutputFile=Document-unlocked.pdf -sDEVICE=pdfwrite -dNOPAUSE -dbatch -q Document-locked.pdf
# GS>quit()

then unlocked doc gets generated

@danfinlay
danfinlay / How to download streaming video.md
Last active June 29, 2024 04:41
How to download a streaming video with Google Chrome

How to download streaming video

Streaming just means a download that they don't want you to keep. But Chrome's developer tools make it easy to access what's really going on under the hood.

Open Developer Tools

From the page where you want to download some things, go into your chrome menu to open the developer tools. You can either:

1.  (On a mac): Command-option-J
2. (On a PC): Control-alt-J
@jameselsey
jameselsey / User.java
Created December 23, 2013 12:23
Gist for my spock blog post: http://www.jameselsey.co.uk/blogs/techblog/why-all-java-devs-should-at-least-consider-groovy-and-spock-for-testing Place source files in src/main and run `gradle idea` to create an intelliJ project file
package com.jameselsey.demo.spocktutorial.domain;
public class User {
private int id;
private String name;
private int age;
public int getId() {
return id;
@lukas-h
lukas-h / license-badges.md
Last active July 11, 2024 07:00
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)

@ladyada
ladyada / config.txt
Created February 18, 2016 21:57
customized HDMI output
# uncomment if you get no picture on HDMI for a default &quot;safe&quot; mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16