Instantly share code, notes, and snippets.

Ömer Sinan Ağacan osa1

View GitHub Profile
View gist:05f51872efd8fa223b012eece36f3a5f
>>> print &s6Qt_info
$18 = (void (*)(void)) 0x4519d0 <s6Qt_info>
>>> info symbol 0x4519d0
No symbol matches 0x4519d0.
View Cargo.toml
[package]
name = "text-view-auto-scroll"
version = "0.1.0"
authors = ["Ömer Sinan Ağacan <omeragacan@gmail.com>"]
edition = "2018"
[dependencies]
gio = { git = "https://github.com/gtk-rs/gio.git" }
glib = { git = "https://github.com/gtk-rs/glib.git" }
View build.mk
BuildFlavour = quick
ifneq "$(BuildFlavour)" ""
include mk/flavours/$(BuildFlavour).mk
endif
GhcRtsHcOpts += -O0 -g3
SRC_HC_OPTS += -g3
GhcStage1HcOpts += -g3
GhcStage2HcOpts += -g3
View gist:4548c5bc2d167541557e0a349944eb00
make[1]: Entering directory '/home/omer/opt/binutils-gdb'
make[2]: Entering directory '/home/omer/opt/binutils-gdb/libiberty'
make[3]: Entering directory '/home/omer/opt/binutils-gdb/libiberty/testsuite'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/omer/opt/binutils-gdb/libiberty/testsuite'
make[2]: Leaving directory '/home/omer/opt/binutils-gdb/libiberty'
make[2]: Entering directory '/home/omer/opt/binutils-gdb/intl'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/omer/opt/binutils-gdb/intl'
make[2]: Entering directory '/home/omer/opt/binutils-gdb/zlib'
View main.rs
// A drag-and-drop example. You can drag the list items using the icon on the left, and drop them
// to other icons to move the list item. Originally listbox-dnd.c in GTK+ repository. Ported to
// gtk-rs by Ömer Sinan Ağacan <omeragacan@gmail.com>.
extern crate cairo;
extern crate gdk;
extern crate gtk;
use gdk::{Atom, DragAction, DragContext, ModifierType, Screen};
use gtk::*;
View gist:acf449d28c4357c2ac2208571867efce
let mut surface: cairo::ImageSurface = cairo::ImageSurface::create(cairo::Format::ARgb32, alloc.width, alloc.height).unwrap();
let surface_: &mut cairo::Surface = surface.as_ref();
error[E0308]: mismatched types
--> src/main.rs:21:49
|
21 | let surface_: &mut cairo::Surface = surface.as_ref();
| ^^^^^^^^^^^^^^^^ types differ in mutability
|
= note: expected type `&mut cairo::Surface`
View gist:c3a4e9f1d9075bfaa4d0530f5cae95b4
[package]
name = "listbox-dnd"
version = "0.1.0"
authors = ["Ömer Sinan Ağacan <omeragacan@gmail.com>"]
edition = "2018"
[dependencies]
cairo-rs = { git = "https://github.com/gtk-rs/cairo.git" }
gdk = { git = "https://github.com/gtk-rs/gdk.git" }
lazy_static = "1.2.0"
View gist:5dc40ff562a6b252f5123b1a69069b6a
#!/bin/bash
set -x
execs=( CAPS caps dmenu_open eng hstags keys trk )
mkdir $HOME/bin || true
for exec in "${execs[@]}"; do
ln -s `pwd`/$exec $HOME/bin/$exec
View gist:9755f7d7238a3757cfee0b37a183a6d8
diff --git a/compiler/simplCore/FloatIn.hs b/compiler/simplCore/FloatIn.hs
index 2593b1d7a1..fca8056b43 100644
--- a/compiler/simplCore/FloatIn.hs
+++ b/compiler/simplCore/FloatIn.hs
@@ -45,6 +45,7 @@ actually float any bindings downwards from the top-level.
floatInwards :: ModGuts -> CoreM ModGuts
floatInwards pgm@(ModGuts { mg_binds = binds })
= do { dflags <- getDynFlags
+ ; pprTraceM "floatInwards" (ppr binds)
; return (pgm { mg_binds = map (fi_top_bind dflags) binds }) }
View gist:47d71c54406faf9a0f54e090c6089483
BuildFlavour = quick
ifneq "$(BuildFlavour)" ""
include mk/flavours/$(BuildFlavour).mk
endif
GhcRtsHcOpts += -O0 -g3
# Enable when debugging GHC executables:
# GhcStage1HcOpts += -DDEBUG
# GhcStage2HcOpts += -DDEBUG