Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View danvas's full-sized avatar

Daniel Vasquez danvas

View GitHub Profile
@danvas
danvas / README.md
Last active November 28, 2023 20:22
Signing AWS API requests

Signing AWS API requests

Implentation of calculating a signature for signing AWS API requests. Specifically, this script invalidates all files (/*) in a Cloudfront distribution via a signed API request.

To run it, edit the .sh file by settting AWS_ACCESS_KEY, AWS_SECRET_KEY, and DISTRIBUTION_ID with your values, and source the file in a shell:

source signedAWSRequest.sh
@danvas
danvas / README.md
Last active November 28, 2023 20:20
Authorization code flow with PKCE
// Statistics refresher: The R-squared formula
// Time complexity: O(3n)
package main
import "fmt"
type Point struct {
x, y float64
}

Keybase proof

I hereby claim:

  • I am danvas on github.
  • I am danvas (https://keybase.io/danvas) on keybase.
  • I have a public key ASDUr9SFP2AJGFF3T7W__gbPSeHP8C5syP_Y0ZixtY0eAwo

To claim this, I am signing this object:

"""
*** Cache Cloud ***
Version 0.9.0
by Daniel Vasquez
Updated: August 12, 2011
Email: dan@heylight.com
Web: heylight.com
Description:
Python script that creates Maya Particle Disk Cache (PDC) files from a sequence of point cloud data, and also gives you the choice of importing a single point cloud. It could be useful with all the open source data being released from Kinect hacks or 3D scanners. You can start by playing around with Radiohead's House Of Cards data: http://code.google.com/p/radiohead/downloads/list
@danvas
danvas / Complex.cpp
Created November 22, 2011 02:30
Member-function definitions for class Complex.
// Assignment 8: Complex.cpp
// Member-function definitions for class Complex.
// Author: Daniel Vasquez
// Date: Nov. 24th, 2011
#include "Complex.h"
// Default constructor
Complex::Complex( )
@danvas
danvas / maze1.1.cpp
Created November 17, 2011 23:41
maze
// Assignment 07: maze.cpp
// Program that raverses mazes on a right-hand rule basis.
// Author: Daniel Vasquez
// Date: Nov. 17th, 2011
#include <iostream>
using std::cin;
using std::cout;
enum Direction { DOWN, RIGHT, UP, LEFT };
@danvas
danvas / Ex08_25.cpp
Created November 17, 2011 04:27
A maze!
// Exercise 8.25 Solution: Ex08_25.cpp
// This solution assumes that there is only one
// entrance and at most one exit for a given maze, and
// these are the only two zeroes (at most) on the borders.
// NOTE: Your solution should work for all 3 test mazes below
#include <iostream>
using std::cin;
using std::cout;
@danvas
danvas / ex05_11.cpp
Created October 13, 2011 21:10
C++ code that calculates compound interests. (Exercise from Deitel & Deitel)
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
for (int interest = 5; interest <=10; interest++)
{
double amount = 1000.00;
@danvas
danvas / hlCopyAttr.py
Created October 13, 2011 05:59
PyMel function that copies the value(s) of the attribute from sourceObj to targetObj. Handles multi-attributes.
import pymel.core as pm
sourceObj = pm.ls('aFluidShape')[0]
targetObj = pm.ls('myFluidShape')[0]
def hlCopyAttr(sourceObj, targetObj, attribute):
"""Copies the value(s) of the attribute from sourceObj to targetObj. Handles multi-attributes."""
if pm.attributeQuery(attribute, node = targetObj.name(), exists=True): # Execute only if the entered attribute exists
multiAttrCheck = pm.attributeQuery(attribute, node=targetObj.name(), m=1) # Check if it's a multi-attribute or not
if multiAttrCheck: # If the attribute is a multi-attribute, copy the values from each instance