Skip to content

Instantly share code, notes, and snippets.

View alfondotnet's full-sized avatar
🏄‍♂️
🏄 🏄 🏄 🏄 🏄 🏄 🏄

Alfonso Embid-Desmet alfondotnet

🏄‍♂️
🏄 🏄 🏄 🏄 🏄 🏄 🏄
View GitHub Profile
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta content="width=device-width, initial-scale=1" name="viewport"/><link href="/static/favicons/[email protected]" rel="apple-touch-icon" sizes="57x57"/><link href="/static/favicons/[email protected]" rel="apple-touch-icon" sizes="60x60"/><link href="/static/favicons/[email protected]" rel="apple-touch-icon" sizes="72x72"/><link href="/static/favicons/[email protected]" rel="apple-touch-icon" sizes="76x76"/><link href="/static/favicons/[email protected]" rel="apple-touch-icon" sizes="114x114"/><link href="/static/favicons/[email protected]" rel="apple-touch-icon" sizes="120x120"/><link href="/static/favicons/[email protected]" rel="apple-touch-icon" sizes="144x144"/><link href="/static/favicons/[email protected]" rel="apple-touch-icon" sizes="152x152"/><link href="/static/favicons/[email protected]" rel="apple-touch-icon" sizes="180x180"/><link href="/static/favicons/favicon.ico" rel="icon shortcut" type="image/x-icon"/><meta content="su
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><link rel="preconnect" href="https://static.linear.app" crossorigin="anonymous"/><link rel="preconnect" href="https://cdn.sanity.io" crossorigin="anonymous"/><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"/><link rel="preload" as="image" href="https://cdn.sanity.io/images/ornj730p/production/dff9dd98ea36ac93a38ef6405abc866dda659f68-492x492.jpg?w=128&amp;h=128&amp;q=95&amp;auto=format&amp;dpr=2"/><link rel="preload" as="image" href="https://cdn.sanity.io/images/ornj730p/production/4d081a7a9ee2575014ab150f2d74cc3e2266a937-300x300.jpg?w=128&amp;h=128&amp;q=95&amp;auto=format&amp;dpr=2"/><link rel="preload" as="image" href="https://cdn.sanity.io/images/ornj730p/production/c5229881e58cfb3a30c31b036e2965f9f327dcc8-512x512.png?w=128&amp;h=128&amp;q=95&amp;auto=format&amp;dpr=2"/><link rel="preload" as="image" href="https://cdn.sanity.io/images/ornj730p/production/2e281ae34028ff175a63af027de95bca66b9bcb1-2056x944.png?
#!/bin/bash
# Script by @xorinox in Chia's keybcase
pdp="/chia/plots/disk*"
i=1
for dp in $(/usr/bin/find $pdp -maxdepth 0 -type d); do
id=$(basename $dp)
ret=$(/bin/lsblk |/usr/bin/grep "$dp")
if [ $? -ne 0 ]; then
/usr/sbin/findfs LABEL="$id" &>/dev/null
from datetime import datetime
import re
file = open('/home/fon/.chia/mainnet/log/debug.log')
suffixes = ["", ".1", ".2", ".3", ".4", ".5", ".6", ".7"]
finished_compiled = re.compile(r'Finished signage point (\d+)\/\d+')
for s in suffixes:
@alfondotnet
alfondotnet / chia_alerter.py
Last active March 26, 2021 15:47
chia alerter
import requests
import re
import time
import random
import subprocess
MAILGUN_API_KEY = 'API_KEY'
MAILGUN_DOMAIN = 'yourdomain.com'
CHIA_ADDRESS = 'CHIA_ADDRESS'
from datetime import datetime
file = open('/home/user/.chia/mainnet/log/debug.log')
old_timestamp = None
res_by_int_deltas = {}
for l in file:
@alfondotnet
alfondotnet / dummy_graphql_client.js
Last active April 17, 2017 18:50
Dummy graphQL client
export function requestUserData({ headers, userId }) {
return fetch(`${API_URL}/graphql/queries`, {
headers: {
...headers,
'Content-Type': 'application/json',
},
method: 'POST',
body: JSON.stringify({
query: `query RequestUserDataQuery ($userId: Int) {
users (id: $userId) {
@alfondotnet
alfondotnet / apollo_error_sample.js
Last active March 21, 2017 00:37
Weird apollo-client's queryObservable's behaviour
import React from "react";
// ....
// Response from server
// {"data":{"entities":{"edges":[{"cursor":"MQ==","node":{"__id":"1","name":"Coke","__typename":"Brand"},"__typename":"BrandEdge"},{"cursor":"Mg==","node":{"__id":"2","name":"Pepsi","__typename":"Brand"},"__typename":"BrandEdge"},{"cursor":"Mw==","node":{"__id":"3","name":"Heinz","__typename":"Brand"},"__typename":"BrandEdge"}],"pageInfo":{"hasNextPage":false,"startCursor":"MQ==","endCursor":"Mw==","__typename":"PageInfo"},"__typename":"BrandConnection"}}}
const filtersQuery = gql`
query ($first: Int, $name: String, $orderDirection: OrderDirection, $orderProperty: BrandOrderProperty) {
entities: brandsConnection(first: $first, name: $name, orderDirection: $orderDirection, orderProperty: $orderProperty) {
edges {
# -*- encoding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from recommendations.models import *
import httplib, json
from optparse import make_option
import re
from random import randrange
from urllib import quote
import time
@alfondotnet
alfondotnet / Discover Yelp Businesses script
Created September 24, 2016 00:04
Discover Yelp Businesses
# -*- encoding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from recommendations.models import *
import httplib, json, urllib2
from optparse import make_option
import yelp_api
# YOUR API DETAILS
consumer_key = 'XXXXX'
consumer_secret = 'XXXXX'