This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fn get_longest(v: &[String]) -> &str { | |
| assert!(v.len() > 0); | |
| let mut result = &v[0]; | |
| for s in v { | |
| if s.len() > result.len() { | |
| result = &s | |
| } | |
| } | |
| result.as_str() | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @function hsv($h, $s, $v) { | |
| @return mix(mix( | |
| if($h < 60, rgb(255, $h/60*255, 0), | |
| if($h < 120, rgb((120-$h)/60*255, 255, 0), | |
| if($h < 180, rgb(0, 255, ($h-120)/60*255), | |
| if($h < 240, rgb(0, (240-$h)/60*255, 255), | |
| if($h < 300, rgb(($h-240)/60*255, 0, 255), | |
| rgb(255, 0, (360-$h)/60*255)))))), | |
| #fff, $s), #000, $v); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fn is_prime(x: i32) -> bool { | |
| (2..).take_while(|i| i * i <= x).all(|i| x % i != 0) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| trait Peg { | |
| fn p(&self, s: &mut &str) -> bool; | |
| } | |
| struct Wrap<T>(T); | |
| impl<T: Peg> Peg for Wrap<T> { | |
| fn p(&self, s: &mut &str) -> bool { | |
| self.0.p(s) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| project(test) | |
| find_library(COCOA Cocoa) | |
| add_executable(test MACOSX_BUNDLE main.m) | |
| target_link_libraries(test ${COCOA}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0"?> | |
| <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | |
| <fontconfig> | |
| <match target="font"> | |
| <edit name="antialias" mode="assign"> | |
| <bool>true</bool> | |
| </edit> | |
| <edit name="hinting" mode="assign"> | |
| <bool>true</bool> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdint.h> | |
| static uint32_t mul (uint32_t x1, uint32_t x2, uint32_t m) { | |
| return ((uint64_t)x1 * (uint64_t)x2) % m; | |
| } | |
| static uint32_t pow (uint32_t b, uint32_t e, uint32_t m) { | |
| if (e == 0) return 1; | |
| uint32_t f = 1; | |
| // invariant: f*b^e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iterator> | |
| template <class I, class F> class Map { | |
| I _begin; | |
| I _end; | |
| F f; | |
| public: | |
| Map(const I& _begin, const I& _end, const F& f): _begin(_begin), _end(_end), f(f) {} | |
| class Iterator { | |
| I i; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pkgname=adapta-gtk-theme | |
| pkgver=3.20.3.106 | |
| pkgrel=1 | |
| pkgdesc="An adaptive Gtk+ theme based on Material Design Guidelines" | |
| arch=('any') | |
| url="https://github.com/tista500/Adapta" | |
| license=('GPL2') | |
| depends=('gtk3') | |
| source=("https://github.com/tista500/Adapta/archive/$pkgver.tar.gz") | |
| sha256sums=('SKIP') |