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
# Let's say we want a Shipping module | |
config.autoload_paths << Rails.root.join('lib', 'shipping') | |
# Then it's all about naming conventions | |
# In lib/shipping/shipping.rb | |
module Shipping | |
end | |
# Then let's say you want a Client class that will be accessible through Shipping::Client | |
# In lib/shipping/client.rb |
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
export function filterRestaurantsBySearch(restaurants, search){ | |
return restaurants.filter((restaurant) => new RegExp(search, "i").exec(restaurant.restaurantName)) | |
} | |
// ou | |
// que tu appelles comme ça | |
// const onlySearchedRestaurants = filterRestaurantsBySearch(restaurants)(search) | |
export filterRestaurantsBySearch | |
// ensuite dans un autre fichier ou t'en as besoin tu peux faire ça |
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
import App from './App.svelte'; | |
const app = new App({ | |
target: document.querySelector('#server-rendered-html'), | |
hydrate: true | |
}); |
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
const { compile, preprocess } = major_version >= 3 | |
? require('svelte/compiler.js') | |
: require('svelte'); |
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
if ( | |
ast.html && | |
ast.html.children && | |
ast.html.children[1] && | |
ast.html.children[1].children && | |
ast.html.children[1].children[3] && | |
ast.html.children[1].children[3].attributes | |
) { | |
console.log( | |
"main children", |
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
if ( | |
ast.html && | |
ast.html.children && | |
ast.html.children[1] && | |
ast.html.children[1].children && | |
ast.html.children[1].children[3] && | |
ast.html.children[1].children[3].attributes | |
) { | |
console.log( | |
"main children", |
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
// j'ai fait une erreur au niveau du debounce | |
const debouncedRender = useRef( | |
debounce((config) => { | |
console.log("render report", config) | |
}, 1000) | |
) | |
const setChildrenEnabled = (section, enabled) => { | |
const children = section.children | |
let newChildren = {} |
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
<style global> | |
@tailwind base; | |
@tailwind components; | |
@tailwind utilities; | |
</style> |
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
<script lang="ts"> | |
import Tailwind from "./Tailwind.svelte" | |
</script> | |
<Tailwind /> | |
<main> | |
<h1 class="text-red-400">The rest of our app will be here</h1> | |
</main> |
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
const purgecss = require("@fullhuman/postcss-purgecss")({ | |
content: ["./src/**/*.html", "./src/**/*.svelte"], | |
whitelistPatterns: [/svelte-/], | |
defaultExtractor: (content) => content.match(/[A-Za-z0-9-_:/]+/g) || [], | |
}) | |
const dev = process.env.ROLLUP_WATCH |
OlderNewer