Skip to content

Instantly share code, notes, and snippets.

View arya's full-sized avatar

Arya Asemanfar arya

  • San Francisco, California
View GitHub Profile
<fb:user-agent includes="ie 6,ie 7">
<script type="text/javascript">
console.log = function(msg) {
var el = document.createElement('div');
$(el).text(msg);
$('#debug_console').append(el);
};
</script>
<style>
/sbin/ifconfig | grep -Eo "10\.20\.[0-9]{1,3}\.[0-9]{1,3}" | grep -vE "^(255|127)" | sort | uniq | xargs -I{} resolveip {} | awk '{print $6}' | grep -vE "(localhost)"
# original
def randomized
order = self.dup
result = []
result << order.choice! until order.blank?
result
end
# new
def randomized(n = nil)