Skip to content

Instantly share code, notes, and snippets.

@arodu
arodu / AppController.php
Created January 10, 2022 17:24
cakephp ListAction for AppController
<?php
/**
* List action
*/
public function list()
{
$alias = $this->loadModel()->getAlias();
$options = $this->getRequest()->getQuery();
if (method_exists($this->loadModel(), 'get' . $alias . 'List')) {
$list = $this->loadModel()->{'get' . $alias . 'List'}($options);
@arodu
arodu / README-Template.md
Created November 9, 2021 13:46 — forked from DomPizzie/README-Template.md
A simple README.md template

Project Title

Simple overview of use/purpose.

Description

An in-depth paragraph about your project and overview of use.

Getting Started

@arodu
arodu / docker-compose.yml
Last active August 6, 2022 15:51 — forked from rochamarcelo/docker-compose.yml
CakePHP docker setup
version: '3'
services:
cakephp-mysql:
image: mysql:5.7
container_name: cakephp-mysql
working_dir: /application
command: mysqld --sql-mode='NO_ENGINE_SUBSTITUTION' --character-set-server=utf8 --init-connect='SET NAMES UTF8;'
environment:
- MYSQL_USER=my_app
- MYSQL_PASSWORD=secret
@arodu
arodu / deploy.sh
Created June 16, 2021 14:16 — forked from stancl/deploy.sh
Deploy using GitHub actions and SSH to a VPS
#!/bin/sh
set -e
vendor/bin/phpunit
npm run prod
git add .
(git commit -m "Build frontend assets for deployment to production") || true
(git push) || true
@arodu
arodu / .bashrc
Last active June 13, 2021 14:15
bash git promt
[ -r /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion
. /usr/share/git/completion/git-completion.bash
. /usr/share/git/completion/git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=1
# colors!
red="\e[1;31m"
green="\e[1;32m"
yellow="\e[1;33m"
blue="\e[1;34m"
@arodu
arodu / banks_venezuela.csv
Last active June 16, 2024 16:14
códigos de bancos en venezuela
Código Nombre
0102 BANCO DE VENEZUELA
0156 100% BANCO
0172 BANCAMIGA BANCO MICROFINANCIERO C A
0114 BANCARIBE
0171 BANCO ACTIVO
0166 BANCO AGRICOLA DE VENEZUELA
0175 BANCO BICENTENARIO DEL PUEBLO
0128 BANCO CARONI
0163 BANCO DEL TESORO
@arodu
arodu / checkExecutionTime.php
Created March 1, 2021 12:36
check execution time in PHP
<?php
function getTimeStart() {
return microtime(true);
}
function getExecutionTime($start = ''){
if (!empty($start)) {
$end = microtime(true);
return 'Execution: ' . number_format($end - $start,3) . ' milliseconds';
@arodu
arodu / udemy-courses-download-using-cookies.md
Created January 2, 2021 17:47 — forked from barbietunnie/udemy-courses-download-using-cookies.md
Downloading Udemy videos with youtube-dl

How to download your Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)[1] export extension. Save it to file udemy-cookies.txt
  3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {path_to_cookies_file} with respective paths.
$ youtube-dl {course_link} --cookies {path_to_cookies_file}
@arodu
arodu / languages_select.html
Created March 24, 2020 18:48
Languages select html
<select>
<option value="af">Afrikaans</option>
<option value="cs">Čeština</option>
<option value="da">Dansk</option>
<option value="de">Deutsch</option>
<option value="el">Ελληνικά</option>
<option value="en">English</option>
<option value="es">Español (España)</option>
<option value="es-la">Español</option>
<option value="fi">Suomi</option>
@arodu
arodu / meta-tags.md
Created August 27, 2019 14:33 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">