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
const props = { | |
className: 'container', | |
children: 'Hello World' | |
} | |
const element = <div className={props.className} children={props.children} /> | |
const element1 = <div {...props}/> | |
const element2 = <div className="my-class" {...props}/> |
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
#!/usr/bin/python3 | |
import requests | |
r = requests.get('<your website>') | |
if r.status_code is 200: | |
r = requests.post( | |
'https://api.telegram.org/bot<your telegram bot token>/sendMessage', | |
data = {'chat_id':<your telegram chat id>,'text':'Good news, Status code for %s is %s' % (r.url,r.status_code), | |
'disable_notification': True} |
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 random import randint | |
from time import clock | |
class Transition(object): | |
def __init__(self,toState): | |
self.toState = toState | |
def execute(self): | |
print("--Transitioning-- to %s" % self.toState) |
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
var form = new FormData(); | |
var settings = { | |
"async": true, | |
"crossDomain": true, | |
"url": "https://api.imgur.com/3/image", | |
"method": "POST", | |
"headers": { | |
"authorization": "Client-ID YOUR_CLIENT_ID" | |
}, | |
"processData": false, |
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
#no 'string quotes please' | |
[twitter] | |
CONSUMER_KEY=xxxxxxxxxxxx | |
CONSUMER_SECRET=xxxxxxxxxxxx | |
ACCESS_TOKEN=xxxxxxxxxxxx | |
ACCESS_TOKEN_SECRET=xxxxxxxxxxxx |
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 tkinter as tk | |
from tkinter import ttk | |
import urllib.request | |
import json | |
import schedule, time | |
def get_luno(): | |
req = urllib.request.urlopen("https://api.mybitx.com/api/1/ticker?pair=XBTMYR") | |
x = json.loads(req.read().decode("utf-8")) | |
req.close() |
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 | |
# install curl and jq | |
while [ true ] | |
do | |
curl -s https://api.mybitx.com/api/1/ticker?pair=XBTMYR | jq -r '.bid' | |
sleep 10 | |
done | |
NewerOlder