Skip to content

Instantly share code, notes, and snippets.

View seysdev's full-sized avatar
🎯
Working

sebastian yabiku seysdev

🎯
Working
View GitHub Profile
@crizstian
crizstian / solid.js
Last active January 12, 2025 07:50
Code examples of SOLID principles for JavaScript
/*
Code examples from the article: S.O.L.I.D The first 5 priciples of Object Oriented Design with JavaScript
https://medium.com/@cramirez92/s-o-l-i-d-the-first-5-priciples-of-object-oriented-design-with-javascript-790f6ac9b9fa#.7uj4n7rsa
*/
const shapeInterface = (state) => ({
type: 'shapeInterface',
area: () => state.area(state)
})
@joepie91
joepie91 / express-server-side-rendering.md
Last active April 26, 2025 08:11
Rendering pages server-side with Express (and Pug)

Terminology

  • View: Also called a "template", a file that contains markup (like HTML) and optionally additional instructions on how to generate snippets of HTML, such as text interpolation, loops, conditionals, includes, and so on.
  • View engine: Also called a "template library" or "templater", ie. a library that implements view functionality, and potentially also a custom language for specifying it (like Pug does).
  • HTML templater: A template library that's designed specifically for generating HTML. It understands document structure and thus can provide useful advanced tools like mixins, as well as more secure output escaping (since it can determine the right escaping approach from the context in which a value is used), but it also means that the templater is not useful for anything other than HTML.
  • String-based templater: A template library that implements templating logic, but that has no understanding of the content it is generating - it simply concatenates together strings, potenti
@renaco
renaco / .bash_profile
Last active May 27, 2022 16:30
.bash_profile for mac & .bashrc for ubuntu
# only linux and mac
export PATH=~/bin:$PATH
export PATH="/usr/local/mysql/bin:$PATH"
# git bash auto-completion
source `brew --prefix git`/etc/bash_completion.d/git-completion.bash
# latest versions of git has the prompt stuff on an extra file
__git_prompt_file=`brew --prefix git`/etc/bash_completion.d/git-prompt.sh
if [ -f "$__git_prompt_file" ]
then
@staltz
staltz / introrx.md
Last active October 26, 2025 03:06
The introduction to Reactive Programming you've been missing
@webinista
webinista / array.chunk.js
Last active March 29, 2023 23:02
Array.prototype.chunk: Splits an array into an array of smaller arrays containing `groupsize` members
/*
Split an array into chunks and return an array
of these chunks.
With kudos to github.com/JudeQuintana
This is an update example for code I originally wrote 5+ years ago before
JavaScript took over the world.
Extending native objects like this is now considered a bad practice, so use
@boycgit
boycgit / gulpfile.js
Created April 14, 2014 06:24
a gulp config file template
/**
** inspired by markgdyr, http://markgoodyear.com/2014/01/getting-started-with-gulp/
* date:2014年4月14日
* creator:玄农
* mail:bocheng.zbc@alibaba-inc.com
**/
// Load the plugins
var gulp = require("gulp"),
less = require("gulp-less"),