This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Jekyll | |
class CategoryCumulusCloud < Liquid::Tag | |
def initialize(tag_name, markup, tokens) | |
. | |
. | |
. | |
super | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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]); } | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://gist.github.com/TheAshwanik/83158a902e031becad80 | |
https://gist.github.com/TheAshwanik/5985543 | |
https://gist.github.com/TheAshwanik/58875b12848dfc972afe | |
https://gist.github.com/TheAshwanik/4578668 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# linux-meminfo | |
# | |
# by Eric Lindvall <[email protected]> | |
# | |
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
OlderNewer