Skip to content

Instantly share code, notes, and snippets.

@dkalisch
dkalisch / flight.py
Last active August 29, 2015 14:26 — forked from kenners/flight.py
Use Flightradar24.com's internal API to get flight path and output it as KML.
#!/usr/bin/env python3
import simplekml
import urllib.request
try:
import simplejson as json
except ImportError:
import json
fr24_flight_code = ""
@dkalisch
dkalisch / server.R
Last active August 29, 2015 14:25 — forked from withr/server.R
Encrypt password with md5 for Shiny-app.
library(shiny)
library(datasets)
Logged = FALSE;
PASSWORD <- data.frame(Brukernavn = "withr", Passord = "25d55ad283aa400af464c76d713c07ad")
# Define server logic required to summarize and view the selected dataset
shinyServer(function(input, output) {
source("www/Login.R", local = TRUE)
observe({
if (USER$Logged == TRUE) {
@dkalisch
dkalisch / fp-projects-hui.php
Created July 21, 2015 20:50
Moesia_Projects modified file
<?php
class Moesia_Projects_HUI extends WP_Widget {
// constructor
function moesia_projects_hui() {
$widget_ops = array('classname' => 'moesia_projects_hui_widget', 'description' => __( 'Show your most intresting projects.', 'moesia') );
parent::WP_Widget(false, $name = __('Moesia FP: Projects', 'moesia'), $widget_ops);
$this->alt_option_name = 'moesia_projects_hui_widget';
#!/bin/sh
if ps -ef | grep -v grep | grep tweetHarvest.py ; then
exit 0
else
python /PATH/TO/YOUR/tweetHarvest.py &
#Write note to Logfile
echo "[`date`]: twitter.py was not running... Restarted" >> /var/log/twitterHarvest.log
exit 0
fi
#!/bin/python
# Load twython library
import json # Teach python JSON
from twython import Twython, TwythonError, TwythonStreamer # Load libraries for twitter API
import pymongo # Teach python to talk to MongoDB
# Setup Authentificaion Settings
APP_KEY = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' # Consumer key
APP_SECRET = '123456789ABCdfgHIJ987654321' # Consumer secret
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" # Versionnumber of your file
"POT-Creation-Date: 2013-09-28 12:40+CEST\n" # Creation date
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" # Revision date
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" # Contact informations
YOURFILE.py
import gettext # module for the string replacement
t = gettext.translation('APPNAME', "./locales") # where does gettext find the language files
_ = t.ugettext # definition of strings to be translated
name = "Dominik"
print _("Hello world")
print _("My name is: %s") % name