Skip to content

Instantly share code, notes, and snippets.

View WarFox's full-sized avatar
🦊
⭐️ ⭐️ ⭐️ ⭐️ ⭐️

Deepu Mohan Puthrote WarFox

🦊
⭐️ ⭐️ ⭐️ ⭐️ ⭐️
View GitHub Profile
sample gist from emacs gist.el
`SPC g g b`
@WarFox
WarFox / scala-sbt-project-structure.sh
Last active June 1, 2018 16:15
Script to create Scala SBT project directory structure
#!/usr/bin/env bash
touch build.sbt ; touch README.md; mkdir -p project; touch project/plugins.sbt; mkdir -p src/{main/{scala,resources,java},test/{scala,resources,java}}/
@WarFox
WarFox / install-kibana-on-multiple-nodes.sh
Last active October 14, 2016 14:46
Install Kibana on multiple remote servers.
#!/usr/bin/env bash
kibana_nodes=(server1 server2 server3)
elasticsearch_url=http://myelasticsearch.com
function install_kibana {
echo "install kibana"
sudo rpm -i https://download.elastic.co/kibana/kibana/kibana-4.6.1-x86_64.rpm
}
@WarFox
WarFox / git-author-rewrite.sh
Last active October 14, 2015 09:50 — forked from octocat/git-author-rewrite.sh
Rewrite author information in commits
#!/usr/bin/env bash
git filter-branch --env-filter '
OLD_EMAIL=$1
CORRECT_NAME=$2
CORRECT_EMAIL=$3
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@WarFox
WarFox / setup-ruby.sh
Created October 4, 2014 21:52
Inital setup of Ruby using rbenv and ruby-build
#!/bin/bash
# https://gorails.com/deploy/ubuntu/14.04
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv &
wait # wait for cloning to finish
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
@WarFox
WarFox / 0_reuse_code.js
Created April 3, 2014 04:59
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@WarFox
WarFox / StackOverflow.java
Created February 20, 2014 10:51
static int is getting more count than AtomicInteger in single thread, why so?
import java.util.concurrent.atomic.AtomicInteger;
public class StackOverflow {
private static AtomicInteger atomicInteger = new AtomicInteger(0);
private static int staticInt = 0;
public static void main(String args[]) {
int atomicInt = atomicInteger.incrementAndGet();
staticInt++;
@WarFox
WarFox / ace_editor_in_bootstrap_3_container.html
Last active October 27, 2016 08:12
Ace Editor Embedding in Bootstrap 3 container
<!DOCTYPE html>
<html lang="en">
<head>
<title>ACE in Action</title>
<style type="text/css" media="screen">
#editor {
height: 300px;
}
</style>
</head>
@WarFox
WarFox / import.rb
Created August 14, 2013 19:18 — forked from dnagir/import.rb
Import from Blogger to Octopress
require 'rubygems'
require 'nokogiri'
require 'fileutils'
require 'date'
require 'uri'
# usage: ruby import.rb my-blog.xml
# my-blog.xml is a file from Settings -> Basic -> Export in blogger.
data = File.read ARGV[0]
@WarFox
WarFox / PrintWithoutSemiColon.java
Last active December 18, 2015 21:29
Java :: Print "Hello World" without using semicolon (;)
public class PrintWithoutSemiColon {
public static void main(String[] args) {
if (System.out.printf("Hello World!\n") == null) {}
/**
* This one is given by Salil Joshi, in the following LinkedIn discussion
* http://www.linkedin.com/groups/How-print-Hello-World-in-3983267.S.252703117?qid=1ce0f1f0-73f3-4c31-ba37-c27aa8e81b55&trk=group_most_popular-0-b-ttl&goback=%2Egmp_3983267
*/
if (System.out.append("Hello World!\n").equals(null)) {}