Skip to content

Instantly share code, notes, and snippets.

View gianni-di-noia's full-sized avatar
🏠
Working from home

Gianni Di Noia gianni-di-noia

🏠
Working from home
View GitHub Profile
@gianni-di-noia
gianni-di-noia / Berger.py
Last active April 4, 2024 18:03
Algoritmo di Berger
squadre = ['roma', 'juve', 'lazio', 'milan', 'inter', 'samp',
'genoa', 'catania', 'bari', 'atalanta', 'andria', 'barletta', 'chievo',
'pescara', 'fiorentina', 'palermo', 'napoli', 'siena', 'udine', 'bologna']
numero_squadre = len(squadre)
giornate = len(squadre) - 1
def AlgoritmoDiBerger(squadre):
if not numero_squadre % 2 == 0:
@gianni-di-noia
gianni-di-noia / gist:3871842
Created October 11, 2012 11:53
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@gianni-di-noia
gianni-di-noia / app.yaml
Created October 3, 2012 02:36 — forked from darktable/app.yaml
GAE: App.yaml designed for serving a static site on Google App Engine (Python). Copy your static html and files into a folder called "static" next to app.yaml. Contains a bunch of mimetype declarations from html5boilerplate's .htaccess. May not be neces
application: you-app-name-here
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.(appcache|manifest))
mime_type: text/cache-manifest
@gianni-di-noia
gianni-di-noia / twitter.py
Created September 17, 2012 13:53
Twitter OAuth handler (gae/py, webapp2, tweepy)
import webapp2, tweepy
consumer_token = 'CONSUMER KEY'
consumer_secret = 'CONSUMER SECRET'
auth = tweepy.OAuthHandler(consumer_token, consumer_secret)
class Twitter(webapp2.RequestHandler):
def get(self):
oauth_token = self.request.get("oauth_token")
oauth_verifier = self.request.get("oauth_verifier")