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 | |
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
#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
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
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
#!/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
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
package main | |
import ( | |
"flag" | |
"fmt" | |
"net/http" | |
"regexp" | |
) | |
var phoneNumberLink = regexp.MustCompile(`^/\+?\d+$`) |
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
Happy Monday Amirul! | |
This week you'll be working with Ann-Marie, the president of her local honor society. Her honor society meets every week in groups of about 30 people, led by a group leader. The honor society has two kinds of members, regular members that everybody starts as, and exceptional members. | |
In order to become an exceptional member someone has to | |
Be a member for at least 2 years | |
Do 100 hours of community service | |
Be nominated by their group leader | |
Be elected by at least 50% of the group. |
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
// trying to translate c++ codes to dart | |
// http://gameprogrammingpatterns.com/command.html#configuring-input | |
void main() { | |
print("Starting game\n"); | |
JumpCommand jumpCommand = JumpCommand(); | |
FireCommand fireCommand = FireCommand(); | |
WalkCommand walkCommand = WalkCommand(); | |
BlockCommand blockCommand = BlockCommand(); |
OlderNewer