Skip to content

Instantly share code, notes, and snippets.

View cesardv's full-sized avatar

Cesar cesardv

  • Me, Myself, and I, Inc
  • Undiscovered Island in the South Pacific
View GitHub Profile
@cesardv
cesardv / c99intbase10.pl
Created October 25, 2012 01:28
PLC4perl
/[1-9][\d]*([uU]([lL]?|(ll|LL))|([lL]{1,2}[uU]?))/
@cesardv
cesardv / xmlvjson
Created October 29, 2012 17:50
XML vs JSON
<?xml version="1.0" encoding="utf-16"?>
<PersAutoPolicy xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Coverages>
<Coverage>
<Cost>15.0</Cost>
<Deductible></Deductible>
<IsDiscount>false</IsDiscount>
<Limit>1000</Limit>
<Name>MP</Name>
<Option></Option>
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.Response.ErrorListener;
import com.android.volley.Response.Listener;
@cesardv
cesardv / boostrapFontsFallback.html
Created March 5, 2015 04:20
FontAwesome Fallback
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script>
(function($){
var $span = $('<span class="fa" style="display:none"></span>').appendTo('body');
if ($span.css('fontFamily') !== 'FontAwesome' ) {
// Fallback Link
$('head').append('<link href="/css/font-awesome.min.css" rel="stylesheet">');
}
$span.remove();
})(jQuery);
<head>
<!-- Bootstrap CSS CDN -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">
</head>
<body>
<!-- APP CONTENT -->
<!-- jQuery CDN -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<!-- jQuery local fallback -->
@cesardv
cesardv / EC2 Instance Types.md
Created December 10, 2015 08:13 — forked from torsten/EC2 Instance Types.md
AWS EC2 Instance specs and price in one table: http://git.io/ec2-prices

Combine http://aws.amazon.com/ec2/pricing/ and http://aws.amazon.com/ec2/instance-types/#selecting-instance-types into one f*cking table.

Type | Arch | vCPU | ECU | Mem | Storage | EBS-optimized | Network | Price ------|------|------|------|-----|-----|---------|---------------|---------------------|-------- General ||||||||| t1.micro | 32/64 | 1 | Variable | 0.615 | EBS only | - | Very Low | $0.020 m1.small | 32/64 | 1 | 1 | 1.7 | 1 x 160 | - | Low | $0.065 m1.medium | 32/64 | 1 | 2 | 3.75 | 1 x 410 | - | Moderate | $0.130 m1.large | 64 | 2 | 4 | 7.5 | 2 x 420 | Yes | Moderate | $0.260

@cesardv
cesardv / irc.md
Created May 31, 2017 14:22 — forked from xero/irc.md
irc cheat sheet

#IRC Reference

Not intended as a guide for newbies, more like a "cheat sheet" for the somewhat experienced IRC user, especially one who wields some power over a channel.

##The Basics

  • /join #channel
    • Joins the specified channel.
  • /part #channel
    • Leaves the specified channel.
# Usage:
# 1) Ctr+S downloads page to ~/Desktop/books.html
# 2) Run script
# 3) Find your books in /tmp/humble_books
# 4) Read them
# 5) Profit
cat ~/Desktop/books.html |
grep "https://dl.humble.com" |
sed -n -E 's/.data-web\=\"(https://dl.humble.com/([.]+).([a-z]+)?["]+)./\1 \2 \3/p' |
sed 's/&amp;/&/g' > /tmp/humble_books_list && cat /tmp/humble_books_list |
@cesardv
cesardv / hb_all_books_dl.js
Created August 3, 2017 04:54 — forked from graymouser/hb_all_books_dl.js
Humble bundle book bundles - download all books at once
/*
After purchasing a humble book bundle, go to your download page for that bundle.
Open a console window for the page and paste in the below javascript
*/
$('a').each(function(i){
if ($.trim($(this).text()) == 'MOBI') {
$('body').append('<iframe id="dl_iframe_'+i+'" style="display:none;">');
document.getElementById('dl_iframe_'+i).src = $(this).data('web');
}
});