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
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;
<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');
}
});
@cesardv
cesardv / bash-cheatsheet.sh
Created August 3, 2017 16:31 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@cesardv
cesardv / raspberry-pi-vpn-router.md
Created October 2, 2017 15:53 — forked from superjamie/raspberry-pi-vpn-router.md
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@cesardv
cesardv / gist:4c2c4d6875f56fb14a3d1920c869daed
Created November 22, 2017 06:06 — forked from siygle/gist:9678772
Parse Gmail Inbox to sheet
function processInboxToSheet() {
//var threads = GmailApp.getInboxThreads();
// Have to get data separate to avoid google app script limit!
var start = 0;
var threads = GmailApp.getInboxThreads(start, 100);
var sheet = SpreadsheetApp.getActiveSheet();
var result = [];
for (var i = 0; i < threads.length; i++) {
var messages = threads[i].getMessages();
@cesardv
cesardv / postgres-cheatsheet.md
Created April 6, 2020 04:17 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)