Skip to content

Instantly share code, notes, and snippets.

Ömer Sinan Ağacan osa1

Block or report user

Report or block osa1

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 gist:e1bea0bc25906b295222a276d3a276be
diff --git a/Distribution/Simple/PreProcess.hs b/Distribution/Simple/PreProcess.hs
index 4933028..2af2316 100644
--- a/Distribution/Simple/PreProcess.hs
+++ b/Distribution/Simple/PreProcess.hs
@@ -122,6 +122,12 @@ data PreProcessor = PreProcessor {
-- preprocessor's output name format.
type PreProcessorExtras = FilePath -> IO [FilePath]
+-- | A newtype around 'PreProcessorExtras', useful for storing
+-- 'PreProcessorExtras' inside of another type constructor (e.g., a list)
@osa1
osa1 / Cargo.toml
Last active Feb 20, 2019
text view auto scroll bug
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
@osa1
osa1 / main.rs
Last active Jan 24, 2019
listbox-dnd
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
View bisect_script.bash
#!/bin/bash
set -e
set -x
git submodule update --init
make distclean
./boot
./configure
You can’t perform that action at this time.