Skip to content

Instantly share code, notes, and snippets.

View nelson6e65's full-sized avatar
:atom:
Creating software

Nelson Martell nelson6e65

:atom:
Creating software
View GitHub Profile
@jelcaf
jelcaf / Operaciones-Git
Last active August 14, 2023 22:50
Git Tips - Mini-trucos de Git para facilitarme la tarea
#############################################
# Push de la rama actual
git push origin $rama_actual
#############################################
# Volver a un commit anterior, descartando los cambios
git reset --HARD $SHA1
#############################################
# Ver y descargar Ramas remotas
@JensRantil
JensRantil / handle_tab_links.js
Created February 6, 2013 10:50
Code that makes it possible to link directly to a nested (Bootstrap) tab. Also, see http://stackoverflow.com/questions/7862233/twitter-bootstrap-tabs-go-to-specific-tab-on-page-reload
@JeffreyWay
JeffreyWay / laravel.js
Last active April 6, 2024 20:12
Want to send a DELETE request when outside of a form? This will handle the form-creation bits for you dynamically, similar to the Rails implementation. (Requires jQuery, but doesn't have to.) To use, import script, and create a link with the `data-method="DELETE"` attribute.
/*
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-confirm="Are you sure?">
*/
(function() {
@barryvdh
barryvdh / _ide_helper.php
Last active May 6, 2024 07:45
Laravel IDE Helper for Netbeans / PhpStorm / Sublime Text 2 CodeIntel, generated using https://github.com/barryvdh/laravel-ide-helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel 5.5.13 on 2017-09-28.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
exit("This file should not be included, only analyzed by your IDE");
@gerardorochin
gerardorochin / rfc regex
Created June 6, 2013 00:00
Expresion regular para validar RFC
/^([A-Z,Ñ,&]{3,4}([0-9]{2})(0[1-9]|1[0-2])(0[1-9]|1[0-9]|2[0-9]|3[0-1])[A-Z|\d]{3})$/
@dhrrgn
dhrrgn / preg_grep_keys.php
Created June 19, 2013 19:47
preg_grep_keys() allows you to grep over the keys of an array.
<?php
function preg_grep_keys($pattern, $input) {
return preg_grep($pattern, array_keys($input));
}
@cristianoc72
cristianoc72 / violations_to_array.php
Last active January 14, 2022 22:07
Extract, from a ConstraintViolationsList object, an associative array where the keys are property names and values are error messages. This function was originally created to be used inside a Propel2 project. Anyway, it can be used in every project following the PSR-0 and using the Symfony Validator Component.
<?php
/**
* This function was originally created to be used inside a Propel2 project.
* Anyway, it can be used in every project following the PSR-0 and using the Symfony Validator Component.
*
* @see http://symfony.com/doc/current/book/validation.html
* @see https://github.com/propelorm/Propel2/blob/master/documentation/behaviors/validate.markdown
*/
use Symfony\Component\Validator\ConstraintViolationList;
@akoluthic
akoluthic / Ubuntu12.04-g++4.8
Created September 1, 2013 13:35
Install g++ 4.8 on Ubuntu 12.04
*Add the toolchain/test PPA*
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-4.8
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
*If you ever want to update symlinks for a future version:*
sudo rm /usr/bin/g++
sudo ln -s /usr/bin/g++-4.XXX /usr/bin/g++
@domenic
domenic / 0-github-actions.md
Last active April 8, 2024 23:35
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with GitHub Actions

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:

  • It is much easier and requires less steps, because you are already authenticated with GitHub, so you don't need to share secret keys across services like you do when coordinate Travis CI and GitHub.
  • It is free, with no quotas.
  • Anecdotally, builds are much faster with GitHub Actions than with Travis CI, especially in terms of time spent waiting for a builder.
@VenkataRaju
VenkataRaju / DynamicFormulaEvaluator.html
Last active September 1, 2015 12:51
Dynamic Formula Evaluator wtirren in HTML and JavaScript
<!DOCTYPE html>
<!-- Author: Venkata Raju -->
<!--
TODO: 1) Allow multi line in formula (mouse cursor up and down should work)
2) Resizeable table header resize: horizontal
-->
<html>
<meta charset="UTF-8">
<head>
<title>Dynamic Formula Evaluator</title>