Skip to content

Instantly share code, notes, and snippets.

View darkaico's full-sized avatar

Ariel Parra darkaico

View GitHub Profile
// /api/debug/kv-test/route.ts
import { NextRequest, NextResponse } from 'next/server';
import { CacheService } from '@/lib/cacheService';
import { WeatherData, WeatherCondition } from '@/app/types';
export const dynamic = 'force-dynamic';
export async function GET(request: NextRequest) {
try {
const cacheService = new CacheService();
// /api/debug/kv-simple/route.ts
import { NextRequest, NextResponse } from 'next/server';
import { kv } from '@vercel/kv';
export const dynamic = 'force-dynamic';
export async function GET(request: NextRequest) {
try {
const testKey = 'weather:loncopue:2025-07-21:5';
import requests
from urllib.request import urlretrieve
from datetime import datetime
TOKEN = "<api_token_here"
FORM_URLS = "https://api.videoask.com/forms"
headers = {"Authorization": f"Bearer {TOKEN}"}
# I knew that my total videoasks were 84 so I'm going from 20 to 20
@darkaico
darkaico / git_tools.sh
Last active March 24, 2017 13:51
Delete all Tags
# Delete all tags remotely
git tag -l | xargs -n 1 git push --delete origin
# Delete all tags locally
git tag | xargs git tag -d
# Delete all merged branches
git fetch --prune; git branch -r --merged | grep origin | grep -v '>' | grep -v master | xargs -L1 | awk '{sub(/origin\//,"");print}' | xargs git push origin --delete
def assign_marker(people_to_mark, marker_index):
result = list(people_to_mark)
for idx, i in enumerate(people_to_mark):
if marker_index < len(result):
marker_index = marker_index + 1
if marker_index < len(result):
del result[marker_index]
else:
del result[0]
break
@darkaico
darkaico / JsonConverter.php
Last active August 29, 2015 14:08
XML to Json
<?php
/**
* Php JsonConverter
*
* @author Ariel Parra <darkaico@gmail.com>
* @version 0.4.0
*
*/
class JsonConverter {
/**