Skip to content

Instantly share code, notes, and snippets.

💥
KAPOW!

Bramus! bramus

💥
KAPOW!
Block or report user

Report or block bramus

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
@bramus
bramus / feedback.md
Created Mar 13, 2019
RE: Designing An Aspect Ratio Unit For CSS
View feedback.md

The addition of an aspect-ratio property would indeed solve this specific issue. Glad to see it's being discussed (once wrote an extensive post on this myself).

Thinking further on this, this solution is somewhat limited: it only solves the aspect ratio problem.

A more broader solution could be the introduction of a val() function. It would work like the var() function – which reads the value of a custom property – but then for reading values from other properties. The function would yield the computed value of the given property. Combine it with calc() and you're good to go.

In code, it would result in something like this:

.box {
View multi-range-diff.php
<?php
// @ref https://twitter.com/brendt_gd/status/1065534180266782721
$a = range(5, 8);
$b = range(13,16);
$c = range(1,3);
$current = range(1,16);
@bramus
bramus / isSunSup.php
Last active Nov 27, 2018
PHP: Is The Sun Up (standalone version)?
View isSunSup.php
<?php
function sunIsUp(\DateTime $when, $lat, $lon): bool {
$whenTimestamp = $when->getTimestamp();
$sunriseTimestamp = date_sunrise(
$whenTimestamp,
SUNFUNCS_RET_TIMESTAMP,
$lat,
$lon
View gist:6f0de89d49d2f2ffc07e7662613a6a68
# wget
wget -m -p -E -k www.domain.tld
# httrack
httrack http://www.domain.tld +www.domain.tld/* --path './httrack' --verbose
View 0-bridging-react-native-cheatsheet.md
View detox-bitrise.yml
---
format_version: 1.1.0
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
trigger_map:
- push_branch: "*"
workflow: tests
workflows:
_tests_setup:
steps:
- activate-ssh-key: {}
@bramus
bramus / fix.md
Last active May 20, 2018
Fixing the XCode 9.x Simulator 3D/Map Performance issue
View fix.md

Got a slow/unresponsive Simulator with XCode 9.x?

You're most likely using some kind of 3D or Native Maps in your App then, no? Awaiting XCode 9.1 (which contains a fix) here's a workaround which replaces the bundled OpenGLES.framework with the version from XCode 9.0 beta 3.

Please do note …

⚠️ Installing frameworks/binaries from unfamiliar/untrusted resources always involves some risk. I can only say that I’ve been using the linked version without any issues. Your mileage may vary.

Instructions

View config.json
{
"canvas": {
"width": 1200,
"height": 650
},
"backgrounds": [
{
"url": "https://cdn.zender.tv/live/player/thepassion/carddesigns/backgrounds/big/01.png",
"thumbnail_url": "https://cdn.zender.tv/live/player/thepassion/carddesigns/backgrounds/small/01.png",
"colors": {
@bramus
bramus / StreamResponseFactory.php
Created Jan 6, 2017
Glide StreamResponseFactory
View StreamResponseFactory.php
<?php
use League\Flysystem\FilesystemInterface;
class StreamResponseFactory implements \League\Glide\Responses\ResponseFactoryInterface {
public function create(FilesystemInterface $cache, $path) {
return $cache->readStream($path);
}
}
View .tmux.conf
# ssh keys
# `brew install reattach-to-user-namespace
set-option -g default-command "reattach-to-user-namespace -l bash"
# mouse scrolling
set-option -g mouse on
# make scrolling with wheels work
# @ref http://stackoverflow.com/a/33461197/2076595
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
You can’t perform that action at this time.