Skip to content

Instantly share code, notes, and snippets.

@zoranzaric
zoranzaric / include.php
Created June 28, 2009 00:15
include posts or gallerys from a wordpress into a php file
<?php
//this part is on the page from where you want to include the stuff from your wp
function include_wordpress($options) {
$domain = 'example.com';
$script = 'wrapper.php?mode=album&album=AlbumName';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $domain . '/' . $script);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
@zoranzaric
zoranzaric / .vimrc
Created September 6, 2009 09:40
Ein paar meiner dotfiles
colorscheme wombat
set number ruler
set cursorline
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ %{(&fenc==\"\"?&enc:&fenc)}\ %{((exists(\"+bomb\")\ &&\ &bomb)?\"B,\":\"\")}\ %=[POS=%04l,%04v]\ [LEN=%L]
set laststatus=2
"Map CTRL-B to NERDTree
noremap <C-B> :NERDTree<CR>
inoremap [' ['']<Left><Left>
inoremap [<Space> []<Left>
@zoranzaric
zoranzaric / Wordpress-SQL-Snippets.sql
Created December 5, 2009 11:03
Some usefull SQL-Querys for Wordpress
#get all published posts with their tags and categorys
SELECT *
FROM wp_posts
LEFT JOIN wp_term_relationships
ON wp_posts.ID=wp_term_relationships.object_id
LEFT JOIN wp_terms
ON wp_term_relationships.term_taxonomy_id=wp_terms.term_id
WHERE post_status='publish';
#get all published posts for a given tag-id or category-id
client
dev tun
proto udp
remote 10.8.0.1 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert testvpnserver2.crt
T - CPU-Zeit in Sekunden
f - Taktfrequenz in Zyklen pro Sekunde
t - Taktzykluszeit in Sekunden pro Zyklus
MIPS - Millionen von Instruktionen pro Sekunde
CPI - mittlere Anzahl Zyklen pro Instruktion
B - Anzahl Instruktionen
Z - CPU-Zeit in Zyklen
T = Z * t
CPI = Z / (T * MIPS * 10^6)
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.RandomAccessFile;
import java.net.Socket;
import java.net.UnknownHostException;
import java.security.MessageDigest;
nnoremap <c-h> gT
nnoremap <c-l> gt
set go-=mTrb
set showtabline=0
set wildoptions=auto
set cpt=l
highlight StatusLine background: #FFFFFF, color: #000000;
\begin{tabular}{|p{0.15\textwidth}|p{0.75\textwidth}|}
\hline \textbf{Tätige Aktoren} & Entwickler oder Prüfer \\
\hline \textbf{Kurzbeschreibung} & Der Akteur möchte Daten zur Verfügung stellen. \\
\hline \textbf{Normaler Ablauf} &
\begin{enumerate}
\item Akteur startet Server.
\item Akteur wählt eine Datei aus.
\item Daten werden an die Peers übertragen.
\item Akteur beendet den Server.
\end{enumerate} \\
-module(raetsel).
-export([zahl_an_stelle/1]).
zahl_an_stelle(STELLE) ->
zahl_an_stelle(STELLE, 1,0).
zahl_an_stelle(STELLE, ZAEHLER, SUMME) ->
if
SUMME >= STELLE
-> ZAEHLER-1;
true
import XMonad
import XMonad.Config.Gnome
import qualified XMonad.StackSet as W
import XMonad.Util.EZConfig
myManageHook =
composeAll [
resource =? "Do" --> doIgnore,
resource =? "key-mon" --> doIgnore
]