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 / basic-portfolio-filtering-system-jquery-ui-ux-css-grid.markdown
Created September 14, 2017 21:51
Basic Portfolio Filtering System // jQuery // UI/UX // CSS Grid

Basic Portfolio Filtering System // jQuery // UI/UX // CSS Grid

This is a very simple filtering system using jQuery class switching. It could also be done with vanilla JavaScript. The grid is created using CSS Grid Layout. This filter is a good starting place to do some cool things.

I often need just a basic filter for portfolios or categories and it's nearly impossible to find a plugin that just works. So I created one. Feel free to use it in your projects.

Update: This is fully responsive now. I fixed some of the issues with scrolling and padding.

A Pen by Djalma Bina on CodePen.

@djalmabright
djalmabright / index.html
Created September 14, 2017 21:52
Pow! CSS only SVG animation
<div class="center">
<div class="center__image">
<!-- svg -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="background" width="800" height="600" viewBox="0 0 800 600">
<defs>
<clipPath id="clip-path">
<path d="M489,194.27C345,169.72,288,261,288,300c0,40.49,57,130.08,201,105.53,5.43-.93,10.42-1.8,15-2.64V196.7C499.42,195.86,494.43,195.19,489,194.27Z" style="fill: none"/>
</clipPath>
</defs>
<g class="artwork" id="artwork" data-name="artwork">
@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: