Skip to content

Instantly share code, notes, and snippets.

View juan-fdz-hawa's full-sized avatar
🏠
Working from home

Juan Fernandez juan-fdz-hawa

🏠
Working from home
  • Self-employed
  • Dominican Republic
View GitHub Profile
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
<%= f.input :author,
:as => :grouped_select,
:collection => [['Authors', ['Jose', 'Carlos']], ['General', ['Bob', 'John']]],
:group_method => :last %>
<%= f.input :author,
:as => :grouped_select,
:collection => Proc.new { [['Authors', ['Jose', 'Carlos']], ['General', ['Bob', 'John']]] },
:group_method => :last %>
pp App::V1::Resources::Positions.routes.map { |route| "#{route.request_method}-#{route.path}"}
ps ax | grep spring | cut -f1 -d' ' | xargs kill
adb shell setprop log.tag.FA VERBOSE
adb shell setprop log.tag.FA-SVC VERBOSE
adb shell setprop debug.firebase.analytics.app com.getmyboat_v1
adb logcat -v time -s FA FA-SVC
{
"payment_intent_data": {
"capture_method": "manual",
"setup_future_usage": "off_session",
"metadata": {},
"payment_method_types": ["card"],
"billing_address_collection": "required",
"customer": #..,
"line_items": [{
"name": #...,
from django.core.management.base import BaseCommand
from search_seo.models import SeoTemplate
from itertools import product
from django.apps import apps
import os
import time
class Command(BaseCommand):
help = "Migrate location category content to the db"
@juan-fdz-hawa
juan-fdz-hawa / extractor.py
Created June 28, 2022 01:13
Extracts the vendor and product portions from the NVD dataset
import xml.etree.ElementTree as et
from collections import defaultdict
import json
data = []
path = "cpe-dictionary_v2.3.xml"
context = et.iterparse(path, events=("start", "end"))
context = iter(context)
import json
import csv
from collections import defaultdict
from difflib import SequenceMatcher
from functools import lru_cache
nvd = None
with open('extract.json', 'r') as f_handler:
nvd = json.load(f_handler)