Skip to content

Instantly share code, notes, and snippets.

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

Deepu Mohan Puthrote WarFox

🦊
⭐️ ⭐️ ⭐️ ⭐️ ⭐️
View GitHub Profile
@WarFox
WarFox / facebook_mining.r
Created July 1, 2012 14:50 — forked from simecek/facebook_mining.r
Facebook Mining
# go to 'https://developers.facebook.com/tools/explorer' to get your access token
access_token <- "******************* INPUT YOUR ACCESS TOKEN ******************************"
require(RCurl)
require(rjson)
# Facebook json function copied from original (Romain Francois) post
facebook <- function( path = "me", access_token, options){
if( !missing(options) ){
options <- sprintf( "?%s", paste( names(options), "=", unlist(options), collapse = "&", sep = "" ) )
@WarFox
WarFox / fiddle.html
Created September 24, 2012 13:23
Change html content with vanilla javascript
<div id="myelement">Old Text</div>
@WarFox
WarFox / fiddle.html
Created September 24, 2012 15:30
Change html content with jQuery
<div id="myelement">Old Text</div>
@WarFox
WarFox / MainClass.cpp
Created September 26, 2012 13:05
Paisa To Rupee Converter in C++
//============================================================================
// Name : MainClass.cpp
// Author : Deepu Mohan Puthrote
// Version : 1.0
// Created on : 26 Sep 2012
// Copyright : Apache License, Version 2.0
// Description : Class which runs the program, Ansi-style
//=============================================================================
#include "MainClass.h"
@WarFox
WarFox / Spring Roo textarea with rows and cols.tagx.jsp
Last active December 14, 2015 00:09
Spring Roo with cols and rows attributes
<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:spring="http://www.springframework.org/tags" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
<jsp:output omit-xml-declaration="yes" />
<jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" />
<jsp:directive.attribute name="cols" type="java.lang.Integer" required="false" rtexprvalue="true" description="No of columns in the textarea (sets the width)" />
<jsp:directive.attribute name="field" type="java.lang.String" required="true" rtexprvalue="true" description="The field exposed from the form backing object" />
<jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The label used for this field, will default to a message bundle if not supplied" />
<jsp:directive.attribute name=
@WarFox
WarFox / input.tagx.jsp
Last active December 14, 2015 15:09
Spring Roo text field input.tagx with adjustable width attribute
<jsp:root xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:spring="http://www.springframework.org/tags" xmlns:form="http://www.springframework.org/tags/form" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
<jsp:output omit-xml-declaration="yes" />
<jsp:directive.attribute name="id" type="java.lang.String" required="true" rtexprvalue="true" description="The identifier for this tag (do not change!)" />
<jsp:directive.attribute name="field" type="java.lang.String" required="true" rtexprvalue="true" description="The field exposed from the form backing object" />
<jsp:directive.attribute name="label" type="java.lang.String" required="false" rtexprvalue="true" description="The label used for this field, will default to a message bundle if not supplied" />
<jsp:directive.attribute name="labelCode" type="java.lang.String" required="false" rtexprvalue="true" description="Key for label message bundle if label is not supplied" />
<jsp:directive.attr
@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)) {}
@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 / 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 / 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++;