Skip to content

Instantly share code, notes, and snippets.

View ciuncan's full-sized avatar

Ceyhun Can Ulker ciuncan

View GitHub Profile
# This file contains pin mappings for the stock 2020 Creality Ender 3
# V2. To use this config, during "make menuconfig" select the
# STM32F103 with a "28KiB bootloader" and serial (on USART1 PA10/PA9)
# communication.
# If you prefer a direct serial connection, in "make menuconfig"
# select "Enable extra low-level configuration options" and select
# serial (on USART3 PB11/PB10), which is broken out on the 10 pin IDC
# cable used for the LCD module as follows:
# 3: Tx, 4: Rx, 9: GND, 10: VCC
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@ciuncan
ciuncan / chain_with.rs
Last active May 12, 2021 07:31
`chain_with` extension method to `Iterator` that evaluate chained iterator lazily
pub trait IterExt {
type Item;
fn chain_with<F, NI>(self, next_iter_fn: F) -> ChainedWithIter<Self, F, NI>
where
Self: Sized,
NI: Iterator<Item = Self::Item> + Sized,
F: FnMut() -> NI + Sized,
{
ChainedWithIter::new(self, next_iter_fn)
}
@ciuncan
ciuncan / Tupled.scala
Created March 30, 2021 05:42
Add `tupled` method to the companion object of a case class via macro annotations
import scala.annotation.{StaticAnnotation, compileTimeOnly}
import scala.language.experimental.macros
import scala.reflect.macros.whitebox
@compileTimeOnly("enable macro paradise to expand macro annotations")
class Tupled() extends StaticAnnotation {
def macroTransform(annottees: Any*): Any = macro Tupled.impl
}
object Tupled {
def impl(c: whitebox.Context)(annottees: c.Tree*): c.Tree = {

Keybase proof

I hereby claim:

  • I am ciuncan on github.
  • I am ciuncan (https://keybase.io/ciuncan) on keybase.
  • I have a public key ASCZwGSHeGJcRr4SrREV5xmNcat69-qfaedn_yzU2l7yowo

To claim this, I am signing this object:

@ciuncan
ciuncan / diamond_abstract_type_override.scala
Created February 18, 2015 16:53
Diamond inheritance with abstract type member overriding
trait BaseImp
trait Base {
type T <: BaseImp
val TVal: T
}
trait Sub1Imp extends BaseImp {
def x = 1
}
trait Sub1 extends Base {
@ciuncan
ciuncan / phonejs-tl-icons.css
Created April 11, 2014 08:07
PhoneJS Turkish Lira icons for Android and iOS7
.dx-theme-android .dx-icon-tl {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAEwCDAP8Qchx5AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAB3RJTUUH3gQLBzU6pxP7vwAADlpJREFUeNrtnXtQFNeex/s1b5jhNcDYKI9RUFYkCgQ1Ua7W4kSuaGLQsEkMWakyt5LU7t7aR9Xe3btbtVVbtbW1m7r7MJXa5I/ExE2UXK+AYnxEEcREcgXZkfeMMLyHAYdmHkw/z/6xeCu7K/SIjkPj7/MXxZzpPnPOt3/n9/v16V9jGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAYcKV2/MSJEyTHcVv0er0Wx3EJx3EMIYQRBCFhGIYIgpB4nqfUavVgRUXFGEz1w6GU2vHp6WnV5s2b/7SwsHAfQkh68H+EEHrwtyRJ0uXLl3+JYdi/w1SvMAHodDqEEBINBoNhoTaiKIoYhhEwzQuj2MGhKOp/Xe2LQMI0r0ABqFQqDMMwCabwGRWAVqtFCCFxJf9GEMBidp0kZS0AjuO4kiMdEMAiqNVq9GPvfyWGuiAAeR9A1gnEcRyWgJUqgHAsQHiBAghAcQiCIGve530AsACLhdNK7bhOp0Msy4rLoS/j4+NUXV2dIS4ubjWGYbtxHP/N4cOHh0EAEUSj0WAsy4Zj3yPmBH7zzTc5Ho9nc3d39+/v3LlzC03T1tjYWGNTU1MDWIDI5wEwhmHEpymAsbEx84ULF/Jpmt5D03TJ6tWrs3U6nV6tVqsftJEkSaIoSgQBRBiz2YwmJiZkB3qpUUBjYyMxNDRkHBkZoYqKit40GAy74+PjS48ePaqV+24gEFCDACKMwWDAnnQeoKWlJa67uzvTaDQWzc7Ort26davNYrFkxsTExIbtVRMEwfM8CCDSmEwm2VQwju