Skip to content

Instantly share code, notes, and snippets.

View outofcoffee's full-sized avatar

Pete Cornish outofcoffee

View GitHub Profile
@cjwfuller
cjwfuller / gist:4169889
Created November 29, 2012 15:42
Logstash on Centos 6.3 (with GUI)

Logstash on Centos 6.3

Web GUI and Logstash agent on single server

Download logstash:

wget https://logstash.objects.dreamhost.com/release/logstash-1.1.5-monolithic.jar
@duncandee
duncandee / RoboActionBarActivity.java
Created August 5, 2013 05:50
RoboActionBarActivity for AppCompact.
public class RoboActionBarActivity extends ActionBarActivity implements RoboContext {
protected EventManager eventManager;
protected HashMap<Key<?>, Object> scopedObjects = new HashMap<Key<?>, Object>();
@Inject
ContentViewListener ignored; // BUG find a better place to put this
@Override
protected void onCreate(Bundle savedInstanceState) {
import org.jboss.aesh.cl.CommandDefinition;
import org.jboss.aesh.cl.GroupCommandDefinition;
import org.jboss.aesh.cl.Option;
import org.jboss.aesh.console.AeshConsole;
import org.jboss.aesh.console.AeshConsoleBuilder;
import org.jboss.aesh.console.Prompt;
import org.jboss.aesh.console.command.Command;
import org.jboss.aesh.console.command.CommandResult;
import org.jboss.aesh.console.command.invocation.CommandInvocation;
import org.jboss.aesh.console.command.registry.AeshCommandRegistryBuilder;
@reda-alaoui
reda-alaoui / ChildFirstClassLoader.java
Last active June 20, 2017 22:37 — forked from dcshock/ChildFirstClassLoader.java
Child First ClassLoader
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
public class ChildFirstClassLoader extends URLClassLoader {
@petrabarus
petrabarus / command.sh
Created October 28, 2016 06:01
Execute random variable for each xargs argument
#!/usr/bin/env bash
seq 10 | xargs -I X bash -c "echo X \$RANDOM"
Edit your $GROOVY_HOME/conf/groovy-start.conf and add the following line:
load !{user.home}/.groovy/grapes/**.jar
After that your @Grab will work as advertised:
#!/usr/bin/env groovy
@Grab(group='mysql', module='mysql-connector-java', version='5.1.12')
import groovy.sql.Sql
@nschwermann
nschwermann / mobile-AndroidManifest.xml
Created June 30, 2014 02:58
Android Wearable Message API example
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="schwiz.net.weartest" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
@djacobs
djacobs / automatedBuildAndUploadToTestflight.sh
Created April 18, 2012 04:20 — forked from amattn/automatedBuildAndUploadToTestflight.sh
Automated Xcode build and upload to TestFlight.
#!/bin/sh
# Current as working as of 2012/4/17
# Xcode 4.3.2
PROJECT_ROOT="$HOME/SomeDirWhereYourProjectLives/XXXXXXXX"
WORKSPACE="$PROJECT_ROOT/XXXXXXXX.xcodeproj/project.xcworkspace"
CONFIG="AdHoc"
SCHEME="XXXXXXXX"
@lehnerpat
lehnerpat / gh-compare.md
Last active September 3, 2022 04:33
GitHub Compare view

GitHub's compare view is available at:

https://github.com/$USER/$REPO/compare/$REV_A...$REV_B

Naturally, $USER and $REPO are the owner (user/organization) and repository names, respectively.

$REV{A,B} are the two sides of the compare view; they can either be a ref in $USER's repository, i.e. the name of a branch, tag or a commit SHA, or it can be a ref in $OWNER's fork of the repository by using the format $OWNER:$REF.

You can get a diff or patch for the result of the compare view by appending .diff or .patch to the URL, respectively.

@juhaelee
juhaelee / react-typescript.md
Last active January 26, 2023 00:52
React + Typescript Cheatsheet

React + Typescript Cheatsheet

Setup

If you use atom... download & install the following packages:

What are Typescript type definition files? (*.d.ts)