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
/** | |
* By TooTallNate, originally posted at https://gist.github.com/1785026 | |
* A quick little thingy that takes a Stream instance and makes | |
* it emit 'line' events when a newline is encountered. | |
* Modified by Max Weller to accept custom line feed characters (e.g. \r\n) | |
* | |
* Usage: | |
* ‾‾‾‾‾ | |
* var emitLines = require('./emitLines'); | |
* emitLines(process.stdin, "\n") |
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
<?php | |
// Pretty Printer for PHP source code | |
// Edit the (relative or absolute) path to your project here: | |
$root = "../../Notendb/notendb2/"; | |
// Edit the page title here: | |
$pageTitle = "Notendb - Anhang B: Quelltext"; |
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
2013-09-24 22:49:42.625 node-webkit[94806:3513] assertion on /SourceCache/DataDetectorsCore/DataDetectorsCore-354/Sources/Lookup/DDABSource.m:226 "(typeAsNumber != NULL) && (CFGetTypeID(typeAsNumber) == CFNumberGetTypeID()) && (CFNumberGetType(typeAsNumber) == kCFNumberSInt64Type)" failed :DDABAddRecord should not be called with NULL type | |
2013-09-24 22:49:42.625 node-webkit[94806:3513] DDABAddRecord should not be called with NULL type | |
2013-09-24 22:49:42.625 node-webkit[94806:3513] An uncaught exception was raised | |
2013-09-24 22:49:42.625 node-webkit[94806:3513] condition "DDABAddRecord should not be called with NULL type" | |
2013-09-24 22:49:42.626 node-webkit[94806:3513] ( | |
0 CoreFoundation 0x9bf706b1 __raiseError + 193 | |
1 libobjc.A.dylib 0x9ac7a091 objc_exception_throw + 162 | |
2 CoreFoundation 0x9bf705cb +[NSException raise:format:] + 139 | |
3 DataDetectorsCore 0x91a88e72 DDRaiseException + 66 | |
4 DataDetectorsCore |
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
Imports System.Text.RegularExpressions | |
Imports System.Reflection | |
Public Class BatchProcessor | |
Event TraceEvent(ByVal varName As String, ByVal varData As String, ByVal codeLine As Integer) | |
Event PrintEvent(ByVal text As String, ByVal codeLine As Integer, ByVal lineBreak As Boolean) | |
Private Shared rJumpTarget As New Regex("^\s*([a-zA-Z0-9_]+):\s*") | |
Private Shared rCall As New Regex("^\s*[a-zA-Z]+\s+(([a-zA-Z0-9_]+(\[.*\])?)\s*=\s*)?(([a-zA-Z0-9_.]+::)|([a-zA-Z0-9_]+\.))([a-zA-Z0-9_]+)\s*(.*)") | |
Private Shared rCallSet As New Regex("^\s*SET\s+(([a-zA-Z0-9_.]+::)|([a-zA-Z0-9_]+\.))([a-zA-Z0-9_]+)\s*(.*)\s*=\s*(.*)", RegexOptions.IgnoreCase) |
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
#!/usr/bin/node | |
// A = (alphabet, states, q0, Delta, Z) | |
//--> Deterministic Finite Automaton | |
function Automaton(alphabet, Q, q0, Delta, Accept) { | |
this.alphabet = alphabet; | |
this.Q = Q; | |
this.q0 = q0; |
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
// Workingdays - Calculate the number of business days in a given year | |
// Copyright (c) 2014 Max Weller | |
// COMPILE AND RUN: | |
// $ gcc -o workingdays workingdays.c | |
// $ ./workingdays -h | |
// Tested with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) (x86_64-apple-darwin13.1.0) | |
// and gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) (x86_64-linux-gnu) |
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
#!/usr/bin/python | |
# Downloads the current "Astronomy Picture of the Day" from nasa.gov and sets as wallpaper | |
# | |
# Installation steps: | |
# - store this file somewhere and take note of the path | |
# - change WALLPAPER_DIR to some folder in your home directory | |
# and create the folder | |
# - make it executable: | |
# chmod a+x /path/to/change_wallpaper | |
# - follow instructions given in the .plist file to make it run daily |
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
function check_parens(str) { | |
var br=0,skip=false,instr=false; | |
for(var i = 0, len = str.length; i<len; i++) { | |
if(skip) { skip=false; continue; } | |
var z = str[i]; | |
switch(z) { | |
case "[":case "{":case "(": if(!instr)br++;break; | |
case "]":case "}":case ")": if(!instr)br--; if(br==0)return i; break; | |
case "\"":case "'": instr=!instr; | |
case "\\": skip=true; break; |
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/bash | |
RSNAPDIR=/.private/.snapshots | |
EXPDIR=$1 | |
if [ -z "$EXPDIR" ]; then | |
echo Please give folder | |
exit 12 | |
fi |
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
zone.txt: last_change | |
pdnssec rectify-all-zones | |
echo "SELECT name,type,content from records;" | mysql pdns > new_zone.txt | |
diff zone.txt new_zone.txt > zone.diff | |
rm zone.txt | |
mv new_zone.txt zone.txt | |
gzip --stdout zone.diff > diffs/zone.diff.$(date +"%Y%m%d%H%M") | |
mysqldump pdns | ssh -i /root/.ssh/copydns_key ns3.teamwiki.net "mysql pdns" |