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
<?php | |
$handle = fopen("eura.csv", "w"); | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, "https://www.eura2007.fi/rrtiepa/projektilista.php?rahasto=EAKR&type=xml"); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
$eura = curl_exec($ch); | |
curl_close($ch); | |
$eura = preg_replace("/&/", "&", $eura); | |
$projektilista = simplexml_load_string($eura); | |
foreach ($projektilista->projekti as $projekti): |
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/env php | |
<? | |
require 'scraperwiki.php'; | |
$html = scraperwiki::scrape("https://www.eura2007.fi/rrtiepa/projektilista.php?rahasto=ALL&type=xml"); | |
$eura = preg_replace("/&/", "&", $html); | |
$projektilista = simplexml_load_string($eura); | |
$unique_keys = array('projektikoodi'); |
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
local P = {} | |
AI_SOV = P | |
function P.ProposeDeclareWar( minister ) | |
local ai = minister:GetOwnerAI() | |
local ministerCountry = minister:GetCountry() | |
local strategy = ministerCountry:GetStrategy() | |
local year = ai:GetCurrentDate():GetYear() | |
local month = ai:GetCurrentDate():GetMonthOfYear() |
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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<?php | |
//we need this lib for deleting dirs | |
include_once("lib/files.inc.php"); | |
function getbook_admin() { | |
if(!is_dir("tmp")) mkdir("tmp"); | |
$update = tempnam("tmp/", "update_"); | |
$updatetext.= _("Processing...")."<br>"._("Requesting book"); | |
$book = $_POST['book']; |
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
# This file is distributed under the same license as the Booktype package. | |
# | |
# Tomi Toivio <tomi@flossmanuals.net>, 2012. | |
msgid "" | |
msgstr "" | |
"Project-Id-Version: Booktype\n" | |
"Report-Msgid-Bugs-To: \n" | |
"POT-Creation-Date: 2012-04-08 23:25+0200\n" | |
"PO-Revision-Date: 2012-04-14 18:59+0300\n" | |
"Last-Translator: Tomi Toivio <tomi@flossmanuals.net>\n" |
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
<div class="recent-activity"> | |
<h2>Users online:</h2> | |
{% for key, value in users %} | |
{% for username in value %} | |
<div class="user"><a href="{% url view_profile username %}" class="user"><div class="image"><img src="{% url view_profilethumbnail username %}?width=24" al\ | |
t="{{username}}"></div><b>{{ username }}</b></a></div> | |
{% endfor %} | |
{% endfor %} | |
</div> |
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 sputnik | |
client_id = sputnik.get("sputnik:client_id") | |
sputnikchannels = sputnik.smembers("sputnik:channels") | |
chnl = {} | |
for ch in sputnik.rkeys("sputnik:channel:*:channel"): | |
chnl[ch] = sputnik.smembers(ch) |
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
# This file is part of Booktype. | |
# Copyright (c) 2012 Aleksandar Erkalovic <aleksandar.erkalovic@sourcefabric.org> | |
# | |
# Booktype is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU Affero General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# Booktype is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
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
{% extends "base.html" %} | |
{% load i18n %} | |
{% block header %} | |
<title>Booktype</title> | |
<script> | |
$(function() { | |
$("#formsignin").booksparkSignin({'url': '{% url signin %}'}); | |
$("#formregister").booksparkRegister({'url': '{% url signin %}', 'redirect': '{% url view_profile 'XXX' %}'}); |
OlderNewer