Skip to content

Instantly share code, notes, and snippets.

View snapeuh's full-sized avatar
🏆
TBDITW

Romain Etchegoyhen snapeuh

🏆
TBDITW
View GitHub Profile
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var styleEl = document.getElementById('css-layout-hack');
if (styleEl) {
styleEl.remove();
return;
}
styleEl = document.createElement('style');
styleEl.id = 'css-layout-hack';
@sebastian-hsu
sebastian-hsu / gist:da20f6106e6382d2970bcad34480221e
Last active March 5, 2024 14:51
Bitnami enable XDebug /opt/bitnami/php/etc/php.ini
[xdebug]
zend_extension="/opt/bitnami/php/lib/php/extensions/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
@bendc
bendc / randomInterval.js
Created March 9, 2017 21:55
rAF-based random interval
const randomInterval = (() => {
const random = (min, max) => Math.random() * (max - min) + min;
return (callback, min, max) => {
const time = {
start: performance.now(),
total: random(min, max)
};
const tick = now => {
if (time.total <= now - time.start) {
time.start = now;
@batitous
batitous / Optionnel<Array<T>>.swift
Created June 30, 2016 09:47
Compare 2 optionnel arrays in Swift, thanks to Sysy !
// At present, Optional<Array<T>> is not possible to make equatable even though T might be.
// This fakes that that behaviour to make comparisons between optional arrays simpler.
func !=<C: Equatable>(lhs: [C]?, rhs: [C]?) -> Bool {
return !(lhs == rhs)
}
func ==<C: Equatable>(lhs: [C]?, rhs: [C]?) -> Bool {
switch (lhs, rhs) {
case (.Some(let lhs), .Some(let rhs)):
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active November 14, 2024 17:18
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx