This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Full Proof of Concept here http://jsbin.com/hupejawequ/1/edit?html,css,js,output | |
@requireConfirmation(["pay"]) // only request confirmation for the 'pay' method | |
class FormWithButton extends React.Component { | |
constructor() { | |
super(); | |
// We have to bind, () => {} doesnt work | |
this.pay = this.pay.bind(this); | |
this.request = this.request.bind(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
file = open('/home/user/.chia/mainnet/log/debug.log') | |
old_timestamp = None | |
res_by_int_deltas = {} | |
for l in file: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import re | |
import time | |
import random | |
import subprocess | |
MAILGUN_API_KEY = 'API_KEY' | |
MAILGUN_DOMAIN = 'yourdomain.com' | |
CHIA_ADDRESS = 'CHIA_ADDRESS' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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&h=128&q=95&auto=format&dpr=2"/><link rel="preload" as="image" href="https://cdn.sanity.io/images/ornj730p/production/4d081a7a9ee2575014ab150f2d74cc3e2266a937-300x300.jpg?w=128&h=128&q=95&auto=format&dpr=2"/><link rel="preload" as="image" href="https://cdn.sanity.io/images/ornj730p/production/c5229881e58cfb3a30c31b036e2965f9f327dcc8-512x512.png?w=128&h=128&q=95&auto=format&dpr=2"/><link rel="preload" as="image" href="https://cdn.sanity.io/images/ornj730p/production/2e281ae34028ff175a63af027de95bca66b9bcb1-2056x944.png? |
OlderNewer