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 :he { | |
vim +":he $1" +'wincmd o' +'nnoremap q :q!<CR>' | |
} |
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
let header = ['#ifndef ', '# define ', '#endif ' ] | |
function! Insert_header_guards() | |
let basename=substitute(@%, "[^/]*/", "", "g") | |
let underscored=tr(basename, ".", "_") | |
let const=substitute(underscored, ".*", "\\U\\0", "")."_" | |
call setline(1, map(g:header, 'v:val . const')) | |
call append('$', ['','','','#endif ' . const]) | |
5 | |
endfunction |
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
osse@osse-w760:/me/H/M/Fai/Faith No More - 1992 - Angel Dust$ ~/Programmering/mperl3tag/mperl3tag.pl | |
Artist | Album | Track | Title | Genre | Year | |
--------------+------------+-------+---------------------+-------------+----- | |
Faith No More | Angel Dust | 14 | Easy (Extra) | Alternative | 1992 | |
Faith No More | Angel Dust | 12 | Jizzlobber | Alternative | 1992 | |
Faith No More | Angel Dust | 13 | Midnight Cowboy | Alternative | 1992 | |
Faith No More | Angel Dust | 02 | Caffeine | Alternative | 1992 | |
Faith No More | Angel Dust | 09 | Be Aggressive | Alternative | 1992 | |
Faith No More | Angel Dust | 10 | A Small Victory | Alternative | 1992 | |
Faith No More | Angel Dust | 01 | Land of Sunshine | Alternative | 1992 |
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
sub findDuplicates { | |
# @info is an array of hashrefs | |
my @keys = keys $info[0]; | |
grep { | |
for (my $i = 0; $i < scalar(@info) - 1; $i++) { | |
# I want to remove any keys from @keys if two adjacent | |
# values in $info are unequal for the same key | |
$info[$i]{$_} eq $info[$i]{$_} | |
} | |
} @keys; |
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/perl | |
use strict; | |
use warnings; | |
use feature 'say'; | |
# Notice that the values are all equal for some of the keys | |
my @stuff = ( { a => "1", b => "2", c => '4'}, | |
{ a => "1", b => "3", c => '4'}, |
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
autocmd CmdwinEnter * nnoremap <buffer> <CR> <CR>q/"/p | |
autocmd CmdwinEnter * inoremap <buffer> <CR> <CR>q/"/p |
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
#include <stdio.h> | |
#include <unistd.h> | |
int main(int argc, char const *argv[]) { | |
pid_t pid = fork(); | |
if (pid) { | |
printf("The daemon's PID is %i.\n", pid); | |
} | |
else { | |
printf("The daemon is now running.\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
diff --git a/src/core/curvematrix.cpp b/src/core/curvematrix.cpp | |
index c26090a..2a7f3ce 100644 | |
--- a/src/core/curvematrix.cpp | |
+++ b/src/core/curvematrix.cpp | |
@@ -340,15 +340,15 @@ void CurveMatrix::inv_inplace_ATLAS(){ | |
//a fast implementation using ATLAS | |
//this may crash if the library is not found or if it is compiled for the wrong machine in that case revert to the old and slow implementation | |
//ipiv already has the size of M | |
- if (!square()) throw CurveMatrixerr::not_square(); | |
-try{ |
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
diff --git a/example.sh b/example.sh | |
index 08034e3..9f02e0e 100644 | |
--- a/example.sh | |
+++ b/example.sh | |
@@ -2,13 +2,13 @@ | |
if [[ -z "$3" ]] | |
then | |
- echo "Max two arguments" | |
- if [[ -z "$2" ]] |
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
hdata = weechat.hdata_get("irc_server") | |
buffer = weechat.buffer_search_main() | |
weechat.prnt("", "away = %d" % weechat.hdata_integer(hdata, buffer, "is_away")) |