Skip to content

Instantly share code, notes, and snippets.

View cggaurav's full-sized avatar
🏠
Working from home

Gaurav cggaurav

🏠
Working from home
View GitHub Profile
@cggaurav
cggaurav / change_display.sh
Created February 17, 2012 10:04
Change Display
View change_display.sh
xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode VGA1 1920x1080_60.00
xrandr --output VGA1 --mode 1920x1080_60.00
@cggaurav
cggaurav / index.html
Created March 21, 2012 15:07 — forked from mbostock/README.md
Interactive Tree (D3)
View index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Node-Link Tree</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.25.0"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?1.25.0"></script>
<style type="text/css">
circle.node {
@cggaurav
cggaurav / README.markdown
Created September 9, 2012 04:01 — forked from gudbergur/README.markdown
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things
View README.markdown

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string
@cggaurav
cggaurav / .powrc
Created October 11, 2012 16:56
PowRC configuration
View .powrc
if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".rvmrc" ]; then
source "$rvm_path/scripts/rvm"
source ".rvmrc"
fi
View server.js
/* install connect first */
// npm install connect
var connect = require('connect');
connect.createServer(
connect.static(__dirname)
).listen(8080);
/* run as localhost:8080/assets/www/index.html */
@cggaurav
cggaurav / default
Created May 25, 2013 20:38
default.kibana
View default
{
"title": "Logstash Search",
"rows": [
{
"title": "Options",
"height": "50px",
"editable": true,
"collapse": false,
"collapsable": true,
"panels": [
@cggaurav
cggaurav / tabla.kibana
Created May 25, 2013 20:40
table.kibana
View tabla.kibana
{
"title": "Events",
"height": "350px",
"editable": true,
"collapse": false,
"collapsable": true,
"panels": [
{
"loading": false,
"error": false,
@cggaurav
cggaurav / Error loading a custom template on Kibana3
Created May 29, 2013 14:56
Error while loading a custom template on Kibana3
View Error loading a custom template on Kibana3
TypeError: Cannot read property '_source' of undefined
at http://example.com/panels/dashcontrol/module.js:209:44
at i (http://example.com/common/lib/angular.min.js:76:207)
at http://example.com/common/lib/angular.min.js:76:440
at Object.e.$eval (http://example.com/common/lib/angular.min.js:87:39)
at Object.e.$digest (http://example.com/common/lib/angular.min.js:84:474)
at Object.e.$apply (http://example.com/common/lib/angular.min.js:87:198)
at e (http://example.com/common/lib/angular.min.js:94:196)
at p (http://example.com/common/lib/angular.min.js:97:332)
at XMLHttpRequest.v.onreadystatechange (http://example.com/common/lib/angular.min.js:98:252)
@cggaurav
cggaurav / kibana_errors
Created May 30, 2013 13:16
AngularJS errors Kibana3
View kibana_errors
TypeError: Cannot call method 'toString' of undefined
at Object.<anonymous> (http://example.herokuapp.com/panels/table/module.js:272:14)
at e (http://example.herokuapp.com/common/lib/angular.min.js:67:353)
at xa.| (http://example.herokuapp.com/common/lib/angular.min.js:128:275)
at Object.get (http://example.herokuapp.com/common/lib/angular.min.js:66:506)
at Object.e.$digest (http://example.herokuapp.com/common/lib/angular.min.js:85:53)
at Object.e.$apply (http://example.herokuapp.com/common/lib/angular.min.js:87:198)
at Array.<anonymous> (http://example.herokuapp.com/panels/hits/module.js:245:21)
at x (http://example.herokuapp.com/common/lib/LAB.min.js:5:3686)
at Object.e.wait (http://example.herokuapp.com/common/lib/LAB.min.js:5:4439)
@cggaurav
cggaurav / module.js
Created June 7, 2013 17:44
toString errors
View module.js
.filter('highlight', function() {
return function(text) {
if (text.toString().length > 0 && !_.isUndefined(text) && !_.isNull(text)) {
return text.toString().
replace(/&/g, '&amp;').
replace(/</g, '&lt;').
replace(/>/g, '&gt;').
replace(/\r?\n/g, '<br/>').
replace(/@start-highlight@/g, '<code class="highlight">').
replace(/@end-highlight@/g, '</code>')