Skip to content

Instantly share code, notes, and snippets.

View phmongeau's full-sized avatar
🤖

Philippe Mongeau phmongeau

🤖
View GitHub Profile
@phmongeau
phmongeau / reload_ff.applescript
Created October 13, 2012 18:43
Reload firefox from terminal
tell application "Firefox"
activate
tell application "System Events" to keystroke "r" using command down
tell application "Terminal" to activate
end tell
@phmongeau
phmongeau / locater.py
Created November 28, 2011 22:36
Geolocalistaion des bibliothèques de Montréal
# -*- coding: utf-8 -*-
import json
import requests
import urllib
from urllib import urlopen
import codecs
import time
url = u"http://maps.googleapis.com/maps/api/geocode/json?address={0}&sensor=false"
@phmongeau
phmongeau / index.html
Last active September 26, 2015 14:27
Simple dropdown menu prototype
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
ul.nav li
{
display: block;
padding: 3px;
#!/usr/bin/env python
from datetime import datetime
from urllib import urlopen
from lxml.html import fromstring
class Prevision(object):
def __init__(self):
return
@phmongeau
phmongeau / tomorow.sh
Created March 7, 2011 00:48
affiche prévisions meteo du lendemain pour montreal
curl --silent http://text.www.weatheroffice.gc.ca/canada_f.html?Day=3#mapTop |
iconv -f ISO-8859-1 -t UTF-8 |
grep Montr |
sed -e 's/<[^>]*>/ /g' -e 's/ / /g' -e 's/^ //g' -e 's/&deg;/°/g' -e 's/Montréal /Demain:/g'
@phmongeau
phmongeau / meteo.sh
Created February 22, 2011 00:50
affiche les condition meteo actuelles pour montreal
curl --silent "http://texte.www.meteo.gc.ca/rss/city/qc-147_f.xml" | iconv -f ISO-8859-1 -t UTF-8 | grep "Conditions actuelles:" |
sed -e 's/Conditions actuelles: //' -e 's/ <title>//' -e 's/<\/title>//' -e 's/&#xB0;/°/'
curl --silent "http://texte.www.meteo.gc.ca/rss/city/qc-147_f.xml" | grep "Conditions actuelles:" |
sed -e 's/Conditions actuelles: //' -e 's/ <title>//' -e 's/<\/title>//' -e 's/&#xB0;/°/'
@phmongeau
phmongeau / meteo.rb
Created February 15, 2011 03:29
gets the current wheater condition from http://meteo.gc.ca
#!/usr/bin/env ruby
require 'rubygems'
require 'nokogiri'
require 'open-uri'
page = Nokogiri::HTML(open('http://texte.www.meteo.gc.ca/forecast/city_f.html?qc-147&unit=m'))
cond = ""
@phmongeau
phmongeau / FlxButton.java
Created January 29, 2011 00:46
fixed just touch for swipe buttons
package org.flixel;
/**
* A simple button class that calls a function when clicked by the mouse.
* Supports labels, highlight states, and parallax scrolling.
*/
public class FlxButton extends FlxGroup
{
/**
@phmongeau
phmongeau / sort.sh
Created July 29, 2010 01:06
A script to sort files in my download folder
#!/bin/sh
cd ~/Downloads/
#Images:
mv *.png IMG/
mv *.PNG IMG/
mv *.jpg IMG/
mv *.JPG IMG/
mv *.tiff IMG/
mv *.gif IMG/
mv *.gif IMG/