Skip to content

Instantly share code, notes, and snippets.

View luciovilla's full-sized avatar

Lucio Villa luciovilla

View GitHub Profile
@luciovilla
luciovilla / config.json
Last active November 22, 2023 18:14
test
{
"f5615ba6-a142-440f-ac38-d20d9a05fcc4": {
"forceTags": ["force-youtube"],
}
}
@luciovilla
luciovilla / wmata_api_stations.json
Created October 11, 2022 03:41
Full list of stations from WMATA API request
{
"Stations": [
{
"Code": "A01",
"Name": "Metro Center",
"StationTogether1": "C01",
"StationTogether2": "",
"LineCode1": "RD",
"LineCode2": null,
"LineCode3": null,
import { useRef } from 'react';
import { useRouter } from 'next/router';
export default function SearchComponent() {
const searchInputRef = useRef(null);
const router = useRouter();
const search = (event) => {
event.preventDefault();
@luciovilla
luciovilla / addTeam2Repo.js
Created March 6, 2020 02:50
adding github team to org repo in node with octokit js
#!/usr/bin/node
const { Octokit } = require('@octokit/rest')
const octokit = new Octokit({
auth: AUTH_TOKEN,
})
const addTeam2Repo = async () => {
try {
await octokit.teams.addOrUpdateRepoInOrg({
@luciovilla
luciovilla / dateConverter.js
Created July 16, 2018 17:56
Convert current date to AP style
function dateConverter(timeStamp){
var UNIX_timestamp = new Date(timeStamp.replace(/\s/, 'T')).getTime();
var a = new Date(UNIX_timestamp);
var months = ['Jan.','Feb.','March','April','May','June','July','Aug.','Sept.','Oct.','Nov.','Dec.'];
var year = a.getFullYear();
var month = months[a.getMonth()];
var day = a.getDate();
var time = month + ' ' + day + ', ' + year ;
return time;
}
@luciovilla
luciovilla / cal_fires_kmlz.md
Created October 20, 2017 19:31
Useful tools for handling KML files
@luciovilla
luciovilla / imagemagic_commands.md
Created August 1, 2016 19:21
Useful imagemagick commands for newsrooms

Useful ImageMagick commands for newsrooms

Quickly create, edit, compose or convert images from the command line.

www.imagemagick.org

Installing

$ brew install imagemagick
@luciovilla
luciovilla / ffmpeg_commands.md
Last active July 15, 2021 21:43
Useful ffmpeg commands for newsrooms

Useful ffmpeg commands for newsrooms

Quickly resize, convert, extract audio from videos and edit audio from the command line.

About ffmpeg

A complete, cross-platform solution to record, convert and stream audio and video. https://ffmpeg.org

Installing

Install Homebrew first

@luciovilla
luciovilla / t-migrahack16-cli.md
Last active June 3, 2016 15:11 — forked from dannguyen/t-nicar16-cli.md
Using the command-line tools t and csvkit to track the #Migrahack hashtag

Using the t and csvkit to quickly collect and analyze #migrahack tweets from the command-line

The t command-line Twitter tool is a great way to work with Twitter information in a spreadsheet.

Its homepage with good installation instructions is here:

https://github.com/sferik/t

And I've written some related instructions about how to get an authentication token from Twitter:

import csv
import time
from pygeocoder import Geocoder
from pygeocoder import GeocoderError
# We can only geocode up to 2500 properties a day (per IP Address)
input_file = open('data.csv', 'r') # Opens the .csv file
output_file = open('data_new.csv', 'w') # Make an empty .csv This is where your geocodes will end up.
data = csv.reader(input_file)