Skip to content

Instantly share code, notes, and snippets.

View cumanacr's full-sized avatar

Cristian Umaña cumanacr

  • Costa Rica
  • 16:24 (UTC -06:00)
View GitHub Profile
@cumanacr
cumanacr / malespin.js
Last active July 17, 2021 21:52
malespin.js
/*
https://es.wikipedia.org/wiki/Malesp%C3%ADn
a por e
e por a
i por o
o por i
b por t
t por b
f por g
g por f
@cumanacr
cumanacr / how to install svelte@next with tailwind jit
Last active July 2, 2021 22:56
how to install svelte@next with tailwind jit
https://jsco.dev/blog/how-to-set-up-tailwindcss-with-svelte-kit
Svelte
How to set up Tailwindcss (jit) with the new Svelte kit
29. March 2021 • 1 min reading time
Svelte kit and the new Tailwindcss just-in-time compiler just got released. Here's a super quick rundown on how to set them up (updated for tailwind 2.1 on the 8/4/2021):
Remember: Svelte config files need to use the cjs extension instead of js
@cumanacr
cumanacr / gotitas_del_saber_mysql.txt
Last active May 8, 2021 18:59
gotitas_del_saber_mysql.txt
-- se puede usar para probar si hay conexión a una base de datos
SELECT 1
-- se puede usar para ver si existe una tabla de millones de registros rápido
-- sin riesgo de traer el millón de registros por error
SELECT 1 FROM megatablagigante WHERE 1 = 0
-- se puede usar para ver si existe una tabla de millones de registros rápido
-- sin riesgo de traer el millón de registros por error
-- con alguna columna específica
@cumanacr
cumanacr / stash_dropped.md
Created April 29, 2021 00:19 — forked from joseluisq/stash_dropped.md
How to recover a dropped stash in Git?

How to recover a dropped stash in Git?

1. Find the stash commits

git log --graph --oneline --decorate ( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )

This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph.

@cumanacr
cumanacr / 6 way to pass data between components svelte.txt
Last active January 27, 2021 03:33
6 way to pass data between components svelte
https://medium.com/better-programming/6-ways-to-do-component-communications-in-svelte-b3f2a483913c
https://livebook.manning.com/book/svelte-and-sapper-in-action/chapter-5/v-3/10
Need => Solution
parent passes data to child => props
parent passes HTML and components to child => slots
child notifies parent, optionally including data => events
ancestor makes data available to descendants => context
@cumanacr
cumanacr / audit ip php apache
Created January 24, 2020 22:54
audit ip php apache
Read more: https://stackoverflow.com/questions/3003145/how-to-get-the-client-ip-address-in-php
Source: https://pastebin.com/pBtkhYXJ
function get_ip_address() {
// Check for shared Internet/ISP IP
if (!empty($_SERVER['HTTP_CLIENT_IP']) && validate_ip($_SERVER['HTTP_CLIENT_IP'])) {
return $_SERVER['HTTP_CLIENT_IP'];
}
@cumanacr
cumanacr / permisos-en-servidores-tipo-runcloud-para-suitecrm.txt
Last active May 1, 2021 23:42
permisos-en-servidores-tipo-runcloud-para-suitecrm
Comando para permisos en servidores tipo Runcloud
chmod 755 vendor/ -Rf && chmod -R 775 cache custom modules themes data upload config_override.php
# Este era el comando que se usaba antes parece que no funciona
find . -type d -exec chmod 0755 {} \; && find . -type f -exec chmod 0644 {} \; && chmod -R 775 cache custom modules themes data upload config_override.php config.php
Leer más acá
https://stackoverflow.com/questions/52439416/gnu-bash-correct-syntax-for-file-permissions/52444737#52444737
Check this out:
http://www.ibridge.be/?p=194
@cumanacr
cumanacr / NotoColorEmoji.css
Last active October 9, 2018 01:24
NotoColorEmoji.css
/*
Download the font from this url:
https://noto-website-2.storage.googleapis.com/pkgs/NotoColorEmoji-unhinted.zip
*/
@font-face {
font-family: 'NotoColorEmoji';
font-style: normal;
font-weight: 400;
src: local('Noto Color Emoji'), local('NotoColorEmoji'),
url('fonts/Noto/NotoColorEmoji.ttf') format('truetype')
@cumanacr
cumanacr / genesis_public_key
Created February 21, 2018 18:06
genesis_public_key
04c6bf737fdc6d5718770fac0a24b0f3584a2db3e0708c253619eae53c0468195bc383ca9ba30d6e831decdf3931a02e9c7d6f5c4df2dff45583ddea0649262257;mrbarletta