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/python | |
import netifaces as ni | |
import os | |
ips = [] | |
for interface in ni.interfaces(): | |
if interface[0:3] == "eth" or interface[0:3] == "wla": | |
try: |
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
application: you-app-name-here | |
version: 1 | |
runtime: python | |
api_version: 1 | |
default_expiration: "30d" | |
handlers: | |
- url: /(.*\.(appcache|manifest)) | |
mime_type: text/cache-manifest |
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
#http://stackoverflow.com/a/23201953 | |
#Create a PowerShell Profile: New-Item -Type file -Path $PROFILE -Force | |
#Edit it: notepad $PROFILE | |
#s = git status | |
function Get-GitStatus { & git status $args } | |
New-Alias -Name s -Value Get-GitStatus | |
#c = git commit -m | |
function Get-GitCommit { & git commit -am $args } |
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/sh | |
GIT_WORK_TREE=/home/to/app git checkout -f |
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"> | |
<title> | |
{% block title %} | |
{% endblock %} | |
</title> | |
</head> | |
<body> |
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
# Use with caution! | |
from rest_framework import routers, serializers, viewsets | |
class RouterFactory(object): | |
def __init__( | |
self, | |
router=routers.DefaultRouter(), | |
models=[], | |
base_serializer_class=serializers.ModelSerializer, |
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
debug_mode: true | |
events_source: facebook | |
groups: | |
- | |
meetup: "group_name_1" | |
facebook: "group_name_1" | |
- | |
meetup: "group_name_2" | |
facebook: "group_name_2" | |
links: |
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 sys | |
import requests | |
import urllib | |
from typing import Iterator, Dict, Tuple, List | |
FILENAME = 'list.txt' | |
GOOGLE_MAPS_URL = 'https://maps.googleapis.com/maps/api/geocode/json' | |
API_KEY = '' | |
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
debug_mode: false | |
events_source: meetup | |
links: | |
"google developers": "https://developers.google.com/groups/chapter/117712497785310292400/" | |
"facebook page": "https://www.facebook.com/gdgaracaju" | |
"facebook group": "https://www.facebook.com/groups/gdgaracaju" | |
"twitter": "https://twitter.com/gdgaracaju" | |
"google+": "https://plus.google.com/+GDGAracajuBlogspotBR" | |
"medium": "http://medium.com/gdg-aracaju" | |
"meetup": "https://www.meetup.com/gdgaracaju/" |
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
data = { | |
'full_name': 'Bruce Banner', | |
'birth_date': '1962-05-01', | |
# a lot of other data | |
} | |
cache_id = hash(data['full_name']) | hash(data['birth_date']) | |
cache.set(cache_id, data) |
OlderNewer