This Groovy script can be used to summarize information of a classes fields and compare fields
of several classes. If you use IntelliJ, you may know its
Groovy Shell feature. Just paste
the code into the editor, add classes to the compareTypes
or showClass
methods.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File | |
def dir = new File("~/temp/path/to/files") | |
def target = new File("~/temp/merged.file") | |
def files = dir.listFiles(new FilenameFilter() { | |
@Override | |
boolean accept(File directory, String name) { | |
return name.toLowerCase().endsWith("log"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.json.* | |
import org.yaml.snakeyaml.Yaml | |
new Yaml().dump(new JsonSlurper().parseText("http://.../v2/api-docs".toURL().text)) |
A custom syntax for Sublime Text 3 for easier logfile analysis.
It uses Sublime Text 3's syntax highlighting to color keywords in logfiles. Coloring is based on standard Sublime Text highlighting and may look weird when you changed it.
Type | Sample Keywords |
---|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BoldAsFont=no | |
Columns=120 | |
Rows=32 | |
Font=Consolas | |
FontHeight=14 | |
ConfirmExit=no | |
Padding=10 | |
ForegroundColour=131,148,150 | |
BackgroundColour=0,43,54 | |
CursorColour=133,153,0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add this to agnoster | |
prompt_newline() { | |
if [[ -n $CURRENT_BG ]]; then | |
echo -n "%{%k%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR \n%{%k%F{blue}%}$SEGMENT_SEPARATOR" | |
else | |
echo -n "%{%k%}" | |
fi | |
echo -n "%{%f%}" | |
CURRENT_BG='' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BASE_DIR="/.../.../..." | |
DATA_DIR="$BASE_DIR/work" | |
ARCHIVE_DIR="$BASE_DIR/archive" | |
NOW=$(date +"%Y-%m-%d_%H-%M-%S") | |
DB_NAME='...' | |
DB_USER='...' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Servo.h> | |
/** | |
* SlowServo ========================================= | |
*/ | |
class SlowServo : public Servo { | |
// ------------------------------------------ | |
private: | |
int desiredAngle = 90; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The passenger module (from the libapache2-mod-passenger package) must be | |
# enabled | |
<VirtualHost *:80> | |
ServerName pezi-redmine | |
# this is the passenger config | |
RailsEnv production | |
SetEnv X_DEBIAN_SITEID "default" | |
# CHANGE PassengerAppGroupName FOR OTHER INSTANCES | |
PassengerAppGroupName redmine_default | |
PassengerDefaultUser www-data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Sketch for my spider leg prototype. | |
*/ | |
#import<Servo.h> | |
int interval = 5; | |
unsigned long lastInterval; | |
unsigned long deltaInterval; |