Skip to content

Instantly share code, notes, and snippets.

View bdavidxyz's full-sized avatar
🏠
Working from home

David Boureau bdavidxyz

🏠
Working from home
View GitHub Profile
@bdavidxyz
bdavidxyz / gist:27258cfb940cc01bb24101efaca1de9e
Created December 2, 2024 10:38
Create new Rails 8 app with better defaults
#
# Will be built with VITE, PG, and different bin/dev
# $> cnrav railsvite 8.0.0
# cnrav myapp 8.0.0 --skip-docker --skip-kamal --skip-jbuilder --skip-action-text
#
cnrav ()
{
# Create directory, initialize Rails project
mkdir -p -- "$1" && cd -P -- "$1"
echo "source 'https://rubygems.org'" > Gemfile
::
:: Aliases for windows command line. Heavily inspired by https://gist.github.com/benjamine/5992592
::
:: Installation:
::
:: - create a folder for your aliases (eg: ```c:\cmd-aliases```)
:: - add that folder to your PATH variable
:: - save this script as alias.cmd on that folder
:: - run "alias" to see usage
::
@bdavidxyz
bdavidxyz / gist:1af552194095e0ebde07aec07f631b13
Created January 3, 2019 09:42
remove all stale branch in github
NodeList.prototype.forEach = Array.prototype.forEach;
document.querySelectorAll('.js-branch-row button[type="submit"].text-red').forEach(function(el){el.click()});
JSON.stringify({
h1:$('h1').map(function(){return $.trim($(this).text());}).get(),
h2:$('h2').map(function(){return $.trim($(this).text());}).get(),
h3:$('h3').map(function(){return $.trim($(this).text());}).get(),
h4:$('h4').map(function(){return $.trim($(this).text());}).get(),
h5:$('h5').map(function(){return $.trim($(this).text());}).get(),
h6:$('h6').map(function(){return $.trim($(this).text());}).get()
},null, 2)
@bdavidxyz
bdavidxyz / 50x.html
Created October 2, 2018 09:30
50x_of_clara
<!DOCTYPE html>
<html>
<head>
<meta content="initial-scale=1, maximum-scale=1" name="viewport">
<title>Clara | Erreur 500</title>
<link href="https://fonts.googleapis.com/css?family=Roboto:700" rel="stylesheet">
<style type="text/css">
body {
font-family: 'Roboto';
}
@bdavidxyz
bdavidxyz / 404
Created October 2, 2018 09:27
404_of_clara
<!DOCTYPE html>
<html>
<head>
<meta content="initial-scale=1, maximum-scale=1" name="viewport">
<title>Clara | Erreur 404</title>
<link href="https://fonts.googleapis.com/css?family=Roboto:700" rel="stylesheet">
<style type="text/css">
body {
font-family: 'Roboto';
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// var forceArray = _.cond([
// [_.isArray, _.identity],
// [_.stubTrue,_.stubArray]
// ]);
// forceArray(_.attempt(_.isError, '>_>'))
// _.isError(_.attempt(computeArray, [1,4,5])) ? console.error()
function hello() {
console.log("hello max");
}