This file contains hidden or 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 console | |
import requests | |
from datetime import datetime | |
import json | |
# Check the status of the Apple Dev Center systems. | |
# version 2.0 | |
# | |
# published information has changed from "web page to parse" to "semi-json file to process" |
This file contains hidden or 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 console | |
import requests | |
from bs4 import BeautifulSoup | |
from datetime import datetime | |
# | |
# Check the status of the Apple Dev Center systems. | |
# Offline systems appear in orange | |
# Online systems appear in black | |
# |
This file contains hidden or 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
# Get the sharing / embed snippets from | |
# the non-mobile flickr page of an image. | |
# (if sharing is not restricted on that image). | |
# | |
# Usage: | |
# 1. Copy the flickr photo mobile url to the clipboard | |
# 2. Run this script | |
# 3. Copy the snippet you want! | |
# | |
# A couple of lines come from get_links.py |
This file contains hidden or 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
# Get the sharing / embed snippets from | |
# the non-mobile flickr page of an image. | |
# (if sharing is not restricted on that image). | |
# A couple of lines come from get_links.py | |
# https://pythonadventures.wordpress.com/2011/03/10/extract-all-links-from-a-web-page/ | |
# | |
# Copyright Nicolas Hoibian | |
# Licence: creative common By-Nc-Sa | |
# | |
import sys |
This file contains hidden or 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 | |
export PROJ_NAME='mezzanine_modeltranslation' | |
export VENV_NAME=$PROJ_NAME'_env' | |
#doc for virtualenv -> http://pypi.python.org/pypi/virtualenv | |
echo "This install the test environment for mezzanine + django-modeltranslation" | |
#The rest of the instructions at the end so they are not visible when using a target |
This file contains hidden or 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
#my messy part: add and tweak until it works. Usually followed by remove until it breaks to find the minimal necessary, but not this time. | |
python waf clean | |
export PATH=/usr/local/Cellar/python2.6.7/2.6.7/bin:$PATH | |
export PYTHONPATH=/usr/local/Cellar/python2.6.7/2.6.7 | |
export LD_LIBRARY_PATH=/usr/local/Cellar/python2.6.7/2.6.7:$LD_LIBRARY_PATH | |
export LD_LIBRARY_PATH=/usr/local/Cellar/python2.6.7/2.6.7/lib:$LD_LIBRARY_PATH | |
export LINKFLAGS='-search_dylibs_first -L /usr/local/Cellar/python2.6.7/2.6.7/lib/' | |
#from stackoverflow http://stackoverflow.com/questions/6886578/how-to-install-pycairo-1-10-on-mac-osx-with-default-python | |
export ARCHFLAGS='-arch x86_64' | |
export CC=/usr/bin/gcc |
This file contains hidden or 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
/** | |
* How to create a BufferedImage from a sub rectangle of another BufferedImage, a.k.a. 'clipping'. | |
* inspired by : | |
* http://stackoverflow.com/questions/2825837/java-how-to-do-fast-copy-of-a-bufferedimages-pixels-unit-test-included | |
* | |
* Does an arraycopy of the relevant part of the rasters. | |
* | |
*/ | |
BufferedImage src = ImageIO.read(new File("SomeFile.png")); |
This file contains hidden or 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
//How to create a BufferedImage from a sub rectangle of another BufferedImage, a.k.a. 'clipping'. | |
BufferedImage src = ImageIO.read(new File("SomeFile.png")); | |
Rectangle clip = new Rectangle((src.getWidth() - 200) / 2, (src.getHeight() - 200) / 2, 200, 200); | |
BufferedImage ret = new BufferedImage(clip.width, clip.height, image.getType()); | |
//short but slow clip and paste : | |
ret.getRaster().setRect(-clip.x, -clip.y, image.getData(clip)); |
This file contains hidden or 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
/** @author Nicolas Hoibian */public class QuineJava_NicolasHoibian {public static void main(String[] args) {String src = "/** @author Nicolas Hoibian */public class QuineJava_NicolasHoibian {public static void main(String[] args) {String src = \"#\";src = src.replaceFirst(new String(new char[] { 35 }), src);System.out.println(src.replaceAll(new String(new char[] { 92, 34, 35, 92, 34 }), new String(new char[] { 92, 92, 34, 35, 92, 92, 34 })));}}";src = src.replaceFirst(new String(new char[] { 35 }), src);System.out.println(src.replaceAll(new String(new char[] { 92, 34, 35, 92, 34 }), new String(new char[] { 92, 92, 34, 35, 92, 92, 34 })));}} |