Skip to content

Instantly share code, notes, and snippets.

View cedricvidal's full-sized avatar

Cedric Vidal cedricvidal

View GitHub Profile
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy for Windows (vers 14 February 2006), see www.w3.org">
<title>
My Exhibit's Title
</title>
<link href="exhibit-data.js" type="application/json" rel="exhibit/data">
<script src="http://static.simile.mit.edu/exhibit/api-2.0/exhibit-api.js" type="text/javascript">
</script>
@cedricvidal
cedricvidal / gist:3833314
Created October 4, 2012 12:42
Eclipse Java Template Slf4j Logger
private static ${loggerType:newType(org.slf4j.Logger)} log = ${factoryType:newType(org.slf4j.LoggerFactory)}.getLogger(${enclosing_type}.class);
@cedricvidal
cedricvidal / eclipse-java-templates.xml
Created October 4, 2012 12:44
Eclipse Java Templates
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<templates>
<template autoinsert="true" context="java-members" deleted="false" description="Slf4j Logger" enabled="true" name="log">private static ${loggerType:newType(org.slf4j.Logger)} log = ${factoryType:newType(org.slf4j.LoggerFactory)}.getLogger(${enclosing_type}.class);
</template>
<template autoinsert="true" context="java-members" deleted="false" description="Slf4j Instance level Logger" enabled="true" name="log-instance">private ${loggerType:newType(org.slf4j.Logger)} log = ${factoryType:newType(org.slf4j.LoggerFactory)}.getLogger(this.getClass());&#13;
&#13;
public void setLogger(${loggerType} logger) {&#13;
this.log = logger;&#13;
@cedricvidal
cedricvidal / gist:4030721
Created November 7, 2012 10:18
JMX Remote Unsecured
-Dcom.sun.management.jmxremote.port=<bind_port>
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname=<host_bind_ip>
@cedricvidal
cedricvidal / colorizer.pl
Created November 8, 2012 10:51
Simple PERL colorizer
#!/usr/bin/perl -w
use Term::ANSIColor;
use POSIX qw(strftime);
use Getopt::Long;
Getopt::Long::Configure("no_ignore_case");
%colors = (
'DEBUG' => 'yellow',
'INFO' => 'green',
'WARN' => 'cyan',
@cedricvidal
cedricvidal / .gitignore
Created November 24, 2012 09:25 — forked from adamgit/.gitignore
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# NB: if you are storing "built" products, this WILL NOT WORK,
# and you should use a different .gitignore (or none at all)
# This file is for SOURCE projects, where there are many extra
# files that we want to exclude
#
# For updates, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#########################
@cedricvidal
cedricvidal / underscore.ext.js
Created November 25, 2012 17:58
Some Underscore.js extensions
/*
* @author <a href="mailto:cedric at vidal dot biz">Cedric Vidal</a>
*/
_.mixin({
and : function() {
var funcs = arguments;
return function() {
var args = arguments;
return _.all(_.map(funcs, function(f) {return f.apply(this, args);}), _.identity);
@cedricvidal
cedricvidal / backup.sh
Last active January 17, 2022 16:26 — forked from nherment/backup.sh
ElasticSearch log index backup & restore scripts
#!/bin/bash
# herein we backup our indexes! this script should run at like 3 AM every first day of the month, after logstash
# rotates to a new ES index and theres no new data coming in to the old one. we grab metadatas,
# compress the data files and backs up to whatever long term storage.
. ./config.sh
echo "Checking that index exist in ES"
if [ `curl -sI $ESURL/$INDEXNAME | grep OK | wc -l` -eq 0 ]
then
/**
* @ngdoc overview
* @name AUTO
* @description
*
* Implicit module which gets automatically added to each {@link AUTO.$injector $injector}.
*/
var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
var FN_ARG_SPLIT = /,/;
@cedricvidal
cedricvidal / .gitconfig
Last active November 28, 2017 17:41
.gitconfig
[user]
name = Cedric Vidal
email = cedric@vidal.biz
[color]
ui = true
[alias]
lg = log --all --graph --decorate --oneline
undo = reset --soft HEAD^