Skip to content

Instantly share code, notes, and snippets.

View jpalala's full-sized avatar
🎯
Focusing

Jose Palala jpalala

🎯
Focusing
View GitHub Profile
Building component - determine what is permanent markup and dynamic markup (if dynamic - could be extensible via component argument?)
Or is it content?
When to know if its for content: Is it possible other people will write other of html markup.
For example, in a form, there are input controls. If people can possibly put a dropdown (`<select>`), make your component style be able to handle that.
@jpalala
jpalala / App.svelte
Created April 17, 2020 23:46
svelte-todo
<script>
let todos = [];
function addTodo() {
todos = [...todos, ''];
}
function removeSelf(index) {
todos = [...todos.slice(0, index), ...todos.slice(index + 1)]
}
</script>
{#each todos as todo, index}
@jpalala
jpalala / laravel-tutorial-ideas.md
Created April 14, 2020 06:34
Next ideas for tutorials on Laravel

May topics kayo regarding

  • service providers?
  • Best practices or actual usages?

Other topics.

  • Form validator
  • Queues
  • Frontend w/ React
    • JWT Tokens per user.
function homestack {
( cd ~/codes/homestack && docker-compose $* )
}
@jpalala
jpalala / readmenow.md
Last active March 1, 2020 02:11
git gitlab github workflow (modified, for my projects)
@jpalala
jpalala / gitflowrebasing.md
Created March 1, 2020 02:01 — forked from markreid/gitflowrebasing.md
git flow with rebasing
@jpalala
jpalala / awesome-css.md
Last active August 31, 2021 16:25
awesome css tricks
@jpalala
jpalala / read.md
Last active August 4, 2019 16:41
Homebrew tricks - allow brew to be used by Multiple users on your mac

Brew asks me to do this: sudo chown -R $(whoami) /usr/local/Homebrew

I unfortunately have other users for development on my mac that need access to Homebrew dir to run stuff.

I find an aritcle https://medium.com/@energee/install-brew-for-multiple-users-65af2444df5c

So I create the group 'brew' in the user and groups preferences pane, MThen

  • sudo chgrp -R brew $(brew --prefix)/Homebrew
@jpalala
jpalala / index.html
Created June 30, 2019 06:20
using png base64 as background image and scaling it
<style>
.base64 {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAQAAABpN6lAAAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAHdElNRQfjBh4GBQL0dv9bAAAMEUlEQVR42u2deZAU1R3HP9PHsBEEIawugpKSYHkVIEEjHlhoMAmxTCw1qFiKGiJWiOVZFY9QamGJGrEoLzAmYgSVSEyM8Uhw0YAHeESMIogxZbSUYxF0BdmZ6e6XP7q3ed3TPcdOv9mecn5dRdXOTHe/3+/9ju/v9977AU1qUpOa1KQmNalJTfp6UqZBRqmhkQEcNEDg4CCSeLSRctZNCoBgJKNoY0/24gu+ZDP/5l3veysZQaSPdABO4yF2IBAIbHLkyGF5f+/gYaZUPY2mp1GpJgMYx58QCPLYHsPhyyaPQPAsR3mMVcL82TzF/eyRXt3XgImsR3jslb/yCLZwsq818UI9iQ4EBboQmPH+z+hFB2mwB68jfDWv9LIRrGNojGqbwAQ2eL8TCLqYE6cDBofyAYLl6CUlqoYujZx5i1zok1yEiAoIrg9NnMvB+WwLCTXHvdETnKEPAguHXeTqqgU6sCpSvQWvMoezGMsB7M0BHM4U5vCy9L2sCR8BJhlvfo9kka8hwWtSnAY84Us7x4Y6hjvYSVcR808y0dNLEx0NDQ0d0xv8sfy5SAg5HAYAP/FYz+MUMR+LITS+GVKqv9aJ/b4hRvII5pUNce53t4butf1nOLFu8/a4QPiHIqWaXxfldy149/Ui30CvyAAz6MCzVTrNWOOO+vFs5SLYIYndRnC2Fw6rAfQnFAlRdqLB+b8vThHPjXnALKXsL5d8fAHBwIpATZiytLCzKFpYOAjai+bf9D1PgNp9GYa95h3KrP/CgM/JoZOtAT92eo60O3CuYgawOqADM4BJLOMlpsUZgINgZkgEDynKRYPOy+jR7MveZCU
@jpalala
jpalala / cachedbag.php
Last active April 22, 2019 02:40
caching in laravel eloquent
/* timeout = seconds */
function cacheDB(array $tags, $depKey, $sql, $timeout = 300) {
$data = DB::select(DB::raw($sql));
return Cache::tags($tags)->put($depKey, $sql);
//remember($depKey, $timeout, function() use($sql) {
// Some join query that will return all Managers from selected Department
return DB::select(DB::raw($sql));
});