Skip to content

Instantly share code, notes, and snippets.

View crater2150's full-sized avatar

Alexander Gehrke crater2150

  • Informatik VI, Universität Würzburg
  • Germany
View GitHub Profile
@crater2150
crater2150 / gist:2021203
Created March 12, 2012 11:05
optirun on thinkpad t410
## intel card
# glxspheres
Polygons in scene: 62464
Visual ID of window: 0x11d
Context is Direct
OpenGL Renderer: Gallium 0.4 on llvmpipe (LLVM 0x300)
25.563789 frames/sec - 15.964893 Mpixels/sec
24.566958 frames/sec - 15.342360 Mpixels/sec
25.474749 frames/sec - 15.909286 Mpixels/sec
function client_opacity_set(c, default, max, step)
if c.opacity < 0 or c.opacity > 1 then
c.opacity = default
end
if c.opacity * step < (max-step) * step then
c.opacity = c.opacity + step
else
c.opacity = max
end
sys-kernel/sysrescue-std-sources
sys-kernel/sysrescue-std-sources-3.0.21.302
=sys-kernel/sysrescue-std-sources-3.0.21.302
def divTwo(x):
out = 0
while (x > 0):
n = 1
n2 = n
while (x >= (n+n)):
n2 = n
n = (n + n)
out = (out + (n - n2))
x = (x - n)
AGGRESSIVE="-fgcse-after-reload -finline-functions -fpredictive-commoning -fstack-protector -ftree-vectorize"
AGGRESSIVE2="-fselective-scheduling -fselective-scheduling2 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops"
GRAPHITE="-fgraphite-identity -floop-block -floop-interchange -floop-strip-mine -ftree-loop-distribution"
LTO="-flto"
# cpu specific flags
CPU="-march=corei7 -mcx16 -msahf -mno-movbe -maes -mpclmul -mpopcnt -mno-abm"
CPU="${CPU} -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-tbm -mno-avx"
CPU="${CPU} -msse4.2 -msse4.1 --param l1-cache-size=32"
CPU="${CPU} --param l1-cache-line-size=64 --param l2-cache-size=4096"
!!! All ebuilds that could satisfy ">=x11-libs/gtk+-3.4.0:3[aqua?,wayland?,X?]" have been masked.
!!! One of the following masked packages is required to complete your request:
- x11-libs/gtk+-3.4.3::gentoo (masked by: invalid: DEPEND: USE flag 'prefix' referenced in conditional '!prefix?' is not in IUSE)
- x11-libs/gtk+-3.4.2::gentoo (masked by: invalid: DEPEND: USE flag 'prefix' referenced in conditional '!prefix?' is not in IUSE)
(dependency required by "dev-cpp/gtkmm-3.4.0" [installed])
@crater2150
crater2150 / git config file
Created August 13, 2014 10:40
Make a copy of a git repo with unpacked refs and objects
mkdir new_repo && cd new_repo
git init
git unpack-objects < /path/to/old/repo/.git/objects/pack/*.pack
git unpack-refs
@crater2150
crater2150 / rules.lua
Last active August 29, 2015 14:17
Trying to move different firefox profiles to different tags in awesomewm
{
rule = { class = "Firefox", instance = "Navigator" },
properties = {
tag = tags[rule_screen][2],
floating = false, minimized = false
},
callback = function(client)
client:connect_signal("property::name", function (c)
if string.find(c.name, "Pentadactyl") and not c.moved then
awful.client.movetotag(tags[rule_screen][3], c)
@crater2150
crater2150 / accept-and-infer-ext.zsh
Last active December 8, 2016 10:51
accept and infer for people forgetting to use it before pressing enter
# if there is currently something typed, accept-and-infer-next-history like usual
# if the input line is empty, recall the last command and infer based on that
# needs deduplication of history disabled! (unsetopt HIST_SAVE_NO_DUPS HIST_IGNORE_ALL_DUPS)
local function accept-or-recall-then-infer-history() {
if [[ -z $PREBUFFER$BUFFER ]]; then
zle up-line-or-history
zle infer-next-history
else
zle accept-and-infer-next-history -- "$@"
fi
trait Element[+R]
class NullElement[+R] extends Element[R]
trait BugRepro {
def combineElements(actions: Element[_]*): Element[Unit]
def sequence[R, M[+_] <: TraversableOnce[_]](in: M[Element[R]]): Element[M[R]]
val mySeq = Seq(1,2,3)