Skip to content

Instantly share code, notes, and snippets.

Krzysztof Kowalczyk kjk

Block or report user

Report or block kjk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ProgramVersion.cs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text;
/* This code was written by Krzysztof Kowalczyk (http://blog.kowalczyk.info)
and is placed in public domain. */
View program_version.py
#!/usr/bin/env python
# This code was written by Krzysztof Kowalczyk (http://blog.kowalczyk.info)
# and is placed in public domain.
def v2fhelper(v, suff, version, weight):
parts = v.split(suff)
if 2 != len(parts):
return v
version[4] = weight
View ffprobe usage
`./ffprobe -show_format -show_streams -print_format json $file`
@kjk
kjk / test_ql.go
Created Dec 16, 2013
Testing using github.com/cznic/ql
View test_ql.go
package main
import (
"fmt"
"github.com/cznic/ql"
"log"
"math/rand"
"os"
"sort"
)
@kjk
kjk / test_gob.go
Created Dec 18, 2013
Shows that one cannot append data to a gob file - the decoder will error out with 'extra data in buffer` when trying to decode data written by append.
View test_gob.go
package main
import (
"encoding/gob"
"fmt"
"io"
"log"
"math/rand"
"os"
)
@kjk
kjk / show_caller_name.go
Last active Dec 31, 2015
Shows that we can get the caller's function name without access to source code. go build -o test show_caller_name.go; rm show_caller_name.go; ./test
View show_caller_name.go
package main
import (
"bytes"
"fmt"
"runtime"
)
var (
dunno = []byte("???")
View test_json.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"log"
)
var jsonStr1 string = `{ "foo" :
View IsBlankFast.go
func IsBlankFast(s string) bool {
n := len(s)
for i := 0; i < n; i++ {
c := s[i]
if c == '\r' || c == '\n' || c == ' ' {
continue
}
return false
}
return true
View nstextview.xml
<window title="test" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="335" y="390" width="480" height="360"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1578"/>
<view key="contentView" id="EiT-Mj-1SZ">
<rect key="frame" x="0.0" y="0.0" width="480" height="360"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<scrollView fixedFrame="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="85O-8d-iEd">
View Notes on Go and Image Magick.md

Hard won wisdom: ImageMagick (and its fork GraphicsMagick) are essentiallyh single-threaded due to internal locking.

What it means is that if you use Go bindings and try to get a higher performance by using multiple goroutines, it won't work.

You can’t perform that action at this time.