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
require 'simple-rss' | |
require 'open-uri' | |
class RssReader | |
def parseFeed (url, length) | |
feed_url = url | |
result = SimpleRSS.parse open(feed_url) | |
output = "<html><meta charset=\"utf-8\"><body>"; | |
output += "<h1>#{result.channel.title}</h1><br />" | |
result.items.each_with_index do |item, i| |
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
// imports omitted, dont know why... | |
public class Foo extends TransferHandler { | |
//.../*DRAG &amp; DROP*/ | |
@Override | |
public boolean importData(JComponent comp, Transferable t) { | |
// Make sure we have the right starting points | |
if (!(comp instanceof JTextField)) { | |
return false; | |
} |
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
private Uri CreateArtefactUri(Build build) { | |
string finalArtifactName = string.Empty; | |
try { | |
string artifactInfoUriString = string.Format("http://{0}/guestAuth/repository/download/{1}/{2}/teamcity-ivy.xml", this.teamCityHost, this.buildType, build.Number); | |
using (WebClient wc = new WebClient()) { | |
var artefactInfo = wc.DownloadString(artifactInfoUriString); | |
XDocument artifactInfoXmlDoc = XDocument.Parse(artefactInfo); | |
foreach (var artifactElement in artifactInfoXmlDoc.Element("ivy-module").Element("publications").Elements("artifact").Where(e => e.Attribute("ext").Value == "exe")) { | |
var artifactName = artifactElement.Attribute("name").Value; | |
if (Regex.IsMatch(artifactName, this.artifactNameMatch)) { |
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
# Start `coffee d3-server.coffee` | |
# Then visit http://localhost:1337/ | |
# originally from: https://gist.github.com/Caged/6407459 | |
d3 = require('d3') | |
http = require('http') | |
jsdom = require('jsdom') | |
http.createServer((req, res) -> | |
# Chrome automatically sends a requests for favicons | |
# Looks like https://code.google.com/p/chromium/issues/detail?id=39402 isn't |
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
<html> | |
<head> | |
<title>brand</title> | |
<style> | |
.selected {background-color: lightgrey;} | |
table {border:1px solid black;} | |
td {border:1px solid black;} | |
</style> | |
<script type="text/javascript"> | |
// ready func for knowing when document is ready |
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
echo "check mysql" | |
service mysql status | grep -qE [0-9]{5} | |
if [ $? -eq 0 ]; then | |
echo OK | |
else | |
service mysql start | |
echo "-" | mail -s "fringshaus.de mysql restarted" -r [email protected] [email protected] | |
echo "mysql restarted, mail sent" | |
fi |
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 * as express from 'express'; | |
var app = express(); | |
app.get('/', function (req, res) { | |
res.send('Hello World!'); | |
}); | |
app.listen(3000, function () { | |
console.log('Example app listening on port 3000!'); | |
}); |
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
------------------------------------------------------------------------- | |
USEFUL ONE-LINE SCRIPTS FOR SED (Unix stream editor) Dec. 29, 2005 | |
Compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.5 | |
Latest version of this file (in English) is usually at: | |
http://sed.sourceforge.net/sed1line.txt | |
http://www.pement.org/sed/sed1line.txt | |
This file will also available in other languages: | |
Chinese - http://sed.sourceforge.net/sed1line_zh-CN.html |
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 job builds the project and its dependencies | |
r4c: | |
stage: build | |
image: node:8 | |
# only: | |
# changes: | |
# - r4c/**/* | |
# - types/**/* | |
script: | |
- yarn run writeVersions |