Skip to content

Instantly share code, notes, and snippets.

View djalmabright's full-sized avatar

Djalma Bina djalmabright

View GitHub Profile
import urllib2
import json
key = "[your API key]"
while 1:
zip = raw_input('For which ZIP code would you like to see the weather forecast? ')
url = 'http://api.wunderground.com/api/' + key + '/geolookup/forecast10day/q/' + zip + '.json'
f = urllib2.urlopen(url)
json_string = f.read()
parsed_json = json.loads(json_string)
for day in parsed_json['forecast']['simpleforecast']['forecastday']:
/*!
* jQuery JavaScript Library v1.7.1
* http://jquery.com/
*
* Copyright 2011, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
<!DOCTYPE html>
<html>
<head>
<script src="https://npmcdn.com/react@0.14.2/dist/react.min.js"></script>
<script src="https://npmcdn.com/react-dom@0.14.2/dist/react-dom.min.js"></script>
<script src="https://npmcdn.com/google-map-react@0.14.6/dist/GoogleMapReact.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
.place{
@djalmabright
djalmabright / gist:0547cf2297104463901675d5e11bda3d
Created September 28, 2017 19:03 — forked from erinata/gist:5489247
Gemfile.lock example 2
GEM
remote: https://rubygems.org/
specs:
actionmailer (3.2.13)
actionpack (= 3.2.13)
mail (~> 2.5.3)
actionpack (3.2.13)
activemodel (= 3.2.13)
activesupport (= 3.2.13)
builder (~> 3.0.0)
@djalmabright
djalmabright / github.gql
Created September 29, 2017 20:48 — forked from alexandreaquiles/github.gql
Consulta GraphQL que busca estatísticas do projeto Express: o número de stars, de pull requests abertos, de issues abertas, a data da última release e informações do último commit.
query {
repository(owner:"expressjs", name: "express") {
stargazers {
totalCount
}
pullRequests(states: OPEN) {
totalCount
}
issues(states:OPEN) {
totalCount
<?php
/**
* Coin Dashboard by Christian Haschek
* https://blog.haschek.at
*
* Donations always welcome
* BTC: 1ChrisHMgr4DvEVXzAv1vamkviZNLPS7yx
* ETH: 0x1337C2F18e54d72d696005d030B8eF168a4C0d95
*
* Read more at
import hashlib as hasher
import datetime as date
# Define what a Snakecoin block is
class Block:
def __init__(self, index, timestamp, data, previous_hash):
self.index = index
self.timestamp = timestamp
self.data = data
self.previous_hash = previous_hash
@djalmabright
djalmabright / snakecoin-server-full-code.py
Created February 4, 2018 22:07 — forked from aunyks/snakecoin-server-full-code.py
The code in this gist isn't as succinct as I'd like it to be. Please bare with me and ask plenty of questions that you may have about it.
from flask import Flask
from flask import request
import json
import requests
import hashlib as hasher
import datetime as date
node = Flask(__name__)
# Define what a Snakecoin block is
class Block:
from flask import Flask
from flask import request
node = Flask(__name__)
# Store the transactions that
# this node has in a list
this_nodes_transactions = []
@node.route('/txion', methods=['POST'])
def transaction():
pragma solidity ^0.4.18;
/**
* A contract that pays off, if a user is able to produce a valid solution
* for the Fermat's last theorem
*/
contract Fermat {
/**