Skip to content

Instantly share code, notes, and snippets.

View TheAshwanik's full-sized avatar
💭
Hi.. Don't hesitate to ping me.. I would love an interesting chat about tech.

Ashwani Kumar TheAshwanik

💭
Hi.. Don't hesitate to ping me.. I would love an interesting chat about tech.
View GitHub Profile
@TheAshwanik
TheAshwanik / category_cloud.rb
Last active December 11, 2015 09:18
category_cloud.rb updated for tag_cloud also.
module Jekyll
class CategoryCumulusCloud < Liquid::Tag
def initialize(tag_name, markup, tokens)
.
.
.
super
end
@TheAshwanik
TheAshwanik / JAVA-OutOfMemoryErrorDiagnostic
Last active December 16, 2015 19:50 — forked from rednaxelafx/command_prompt
JAVA-OutOfMemoryErrorDiagnostic
$ cat > OOM.java
import java.util.*;
public class OOM {
public static void main(String[] args) throws Exception {
ArrayList list = new ArrayList();
while (true) { list.add(new byte[20000]); }
}
}
# A small DSL for helping parsing documents using Nokogiri::XML::Reader. The
# XML Reader is a good way to move a cursor through a (large) XML document fast,
# but is not as cumbersome as writing a full SAX document handler. Read about
# it here: http://nokogiri.org/Nokogiri/XML/Reader.html
#
# Just pass the reader in this parser and specificy the nodes that you are interested
# in in a block. You can just parse every node or only look inside certain nodes.
#
# A small example:
#
@TheAshwanik
TheAshwanik / HAR-Related-Stuff
Last active December 19, 2015 16:39 — forked from igrigorik/links.md
Web Performance Power Tool: HTTP Archive (HAR)
https://gist.github.com/TheAshwanik/83158a902e031becad80
https://gist.github.com/TheAshwanik/5985543
https://gist.github.com/TheAshwanik/58875b12848dfc972afe
https://gist.github.com/TheAshwanik/4578668
computer = #path to movies directory
hd = #path to movies directory
def get_movies(path_comp, path_hd)
# Return ana rray with only the new movies. I exclude the directory Series in the search
return `ls #{path_comp} | grep -v Series`.split(/\n/) - `ls #{path_hd} | grep -v Series`.split(/\n/)
end
new_movies_list = get_movies(computer, hd)
#!/usr/bin/env python
"""MailBox class for processing IMAP email.
(To use with Gmail: enable IMAP access in your Google account settings)
usage with GMail:
import mailbox
http://spservices.codeplex.com/SourceControl/latest#jquery.SPServices-2013.01ALPHA5.js
http://ktskumar.wordpress.com/2009/03/03/upload-document-from-local-machine-to-sharepoint-library/
http://davidsit.wordpress.com/2010/02/10/reading-a-sharepoint-list-with-java-tutorial/
http://code.google.com/p/java-sharepoint-library/issues/detail?id=2
http://tugdualgrall.blogspot.co.uk/2009/02/jax-ws-how-to-configure-service-end_17.html
#!/usr/bin/env ruby
#
# linux-meminfo
#
# by Eric Lindvall <eric@5stops.com>
#
# Gather more useful memory statistics for SNMP
#
# To see the example output, run:
# linux-meminfo.rb -g .1.3.6.1.4.1.2021.4.6.0
require 'roo'
# Spreadsheet courtesy of the A List Apart 2010 Web Design Survey:
# http://www.alistapart.com/articles/survey2010
workbook = Excel.new('a-list-apart-web-design-survey-sample.xls')
# Set the worksheet you want to work with as the default worksheet. You could
# also iterate over all the worksheets in the workbook.
workbook.default_sheet = workbook.sheets[0]