Skip to content

Instantly share code, notes, and snippets.

View jhoanborges's full-sized avatar

Jhoan Borges jhoanborges

View GitHub Profile
@gavinblair
gavinblair / labels.css
Created October 20, 2010 17:09
Adds : after labels and * after required labels
/* Adds : after labels */
form label:after{
content:":";
}
/* Adds * after required labels */
form label.required:after{
content:"*";
}
@avar
avar / 30-income-calculon.pl
Last active February 12, 2024 18:34
Calculate your income in The Netherlands with and without a 30% ruling.
# To check if this is up-to-date with the tax rates go to
# http://www.expatax.nl/tax-rates-2016.php and see if there's anything
# newer there.
#
# I make no guarantees that any of this is correct. I calculated this
# at the time and have been updating it when new tax rates come along
# because people keep finding this useful.
#
# There's also an interactive JS version of this created by
# @stevermeister at
@farandal
farandal / gist:6144701
Created August 3, 2013 01:34
Translated default messages for the jQuery validation plugin. Spanish
/*
* Translated default messages for the jQuery validation plugin.
* Locale: ES
*/
jQuery.extend(jQuery.validator.messages, {
required: "Este campo es obligatorio.",
remote: "Por favor, rellena este campo.",
email: "Por favor, escribe una dirección de correo válida",
@koistya
koistya / modal.html
Last active September 18, 2022 05:36
Modal dialog with a YouTube player
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</head>
<body>
@james2doyle
james2doyle / simple-json-reponse.php
Last active March 7, 2024 06:02
A simple JSON response function for PHP. Used in various PhileCMS plugins.
<?php
function json_response($code = 200, $message = null)
{
// clear the old headers
header_remove();
// set the actual code
http_response_code($code);
// set the header to make sure cache is forced
header("Cache-Control: no-transform,public,max-age=300,s-maxage=900");
@soufianeEL
soufianeEL / laravel.js
Last active June 18, 2023 05:25 — forked from JeffreyWay/laravel.js
You use Laravel 5 and you want to send a DELETE request without creating a form? This will handle the form-creation bits for you dynamically, similar to the Rails implementation. To use, import script, and create a link with the `data-method="DELETE"` and `data-token="{{csrf_token()}}"` attributes.
/*
Exemples :
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}">
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}" data-confirm="Are you sure?">
*/
(function() {
@wching
wching / day_hours.json
Created March 29, 2016 22:12
JSON file with all hours in the day
[
{
"military_format": "0000",
"twenty_four_hour_format": "00:00",
"standard_format": "00:00",
"time_of_day":"md"
},
{
"military_format": "0030",
"twenty_four_hour_format": "00:30",
@andrewlimaza
andrewlimaza / honeypot-example.php
Last active July 17, 2024 07:03
Simple honeypot for an HTML form using PHP
<?php
//check if form was sent
if($_POST){
$to = 'some@email.com';
$subject = 'Testing HoneyPot';
$header = "From: $name <$name>";
$name = $_POST['name'];
@igoralves1
igoralves1 / guz.php
Last active November 23, 2020 10:36
Consuming API endpoints with Laravel 5+ AND Guzzle\Http
/*
Installation -> http://docs.guzzlephp.org/en/latest/overview.html#installation
https://www.youtube.com/watch?v=GunXVUqvO-s
https://www.udemy.com/http-clients-with-laravel-use-and-consume-services-and-apis/
add Guzzle as a dependency using the composer.phar CLI:
@kolunar
kolunar / gist:280cf197e25aa45f3cbfb22d20cb8a62
Created April 24, 2017 22:51
How To Set Up Subdomain or multi-domains and Apache Virtual Hosts on Ubuntu 14.04 LTS
Summary
=========
1) Create an A record for your sub-domain that points to your droplet
2) Create a .config file for your sub-domain site in /etc/apache2/sites-available
3) Create the directory for your site in /var/www (or wherever you said it was in the config file)
4) Enable the site in apache with: sudo a2ensite sub.yourdomain.com (or whatever you named your site in the config)
5) reload apache: sudo service apache2 reload
NOTE: the DNS record you create might take awhile to propagate
============================================================================================