Skip to content

Instantly share code, notes, and snippets.

View RickyAvina's full-sized avatar
🎯
Focusing

Enrique Avina RickyAvina

🎯
Focusing
  • Boston, MA
View GitHub Profile
@RickyAvina
RickyAvina / getCookies.swift
Last active June 17, 2017 05:10
Swift Cookie Collector
func getCookies(response: HTTPURLResponse)-> [HTTPCookie] {
var cookies = [HTTPCookie()]
let field = response.allHeaderFields as? [String: String]
if let url = response.url {
cookies = HTTPCookie.cookies(withResponseHeaderFields: field!, for: url)
HTTPCookieStorage.shared.setCookies(cookies, for: url, mainDocumentURL: nil)
for cookie in cookies {
var cookieProperties = [HTTPCookiePropertyKey: Any]()
@RickyAvina
RickyAvina / rename.bash
Created June 30, 2017 00:06
Remove substring from filename Linux
rename 's/IMG_//g' *.jpg
@RickyAvina
RickyAvina / runDIGITSDocker.bash
Created June 30, 2017 15:49
Runs Docker for Digits on localhost:5000 using local folder "opt/ped" and making Docker alias "/data/ped"
nvidia-docker run --name digits -d -p 5000:5000 -v /opt/ped:/data/ped nvidia/digits
@RickyAvina
RickyAvina / killAllDockerInstances.bash
Created June 30, 2017 15:54
Kills and Removes all Docker instances. Great for naming conflicts or old containers.
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
@RickyAvina
RickyAvina / Change Format
Created July 6, 2017 20:57
Change JPEG to PNG using Mogrift
mogrify -format png *.jpeg
@RickyAvina
RickyAvina / jpgToPng.sh
Created February 3, 2018 21:06
JpgToPng for bash terminal
for file in *.txt; do mv "$file" "${file%.txt}.py"; done
@RickyAvina
RickyAvina / ScanManager.cs
Created January 20, 2019 18:18 — forked from sGambolati/ScanManager.cs
SpatialDemo's Final ScanManager.cs file.
using System;
using HoloToolkit.Unity;
using HoloToolkit.Unity.InputModule;
using UnityEngine;
public class ScanManager : MonoBehaviour, IInputClickHandler
{
public TextMesh InstructionTextMesh;
public Transform FloorPrefab;
public Transform WallPrefab;
cd path/to/your/app
php -S localhost:8000
@RickyAvina
RickyAvina / download_google_images.py
Created May 28, 2020 19:14
Download Google Images
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from bs4 import BeautifulSoup
import sys
import os
import requests
import urllib3
from urllib3.exceptions import InsecureRequestWarning
import time
from tqdm import trange
/*
* Copyright (c) 2020 Razeware LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*