Skip to content

Instantly share code, notes, and snippets.

View fabiofdsantos's full-sized avatar

Fábio Santos fabiofdsantos

View GitHub Profile
@mtigas
mtigas / gist:952344
Last active June 20, 2024 11:22
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes:

@maettig
maettig / LICENSE.txt
Created February 3, 2012 16:02 — forked from 140bytes/LICENSE.txt
isValidEan13 in 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2012 Thiemo Mättig <http://maettig.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@sindresorhus
sindresorhus / jsonp-usage.js
Created February 24, 2012 12:38
JSONP function - Easily fetch remote JSONP files
// Example usage: Fetch it's own code from GitHub
JSONP( 'https://api.github.com/gists/1900694?callback=?', function( response ) {
console.log( 'JSONP function:', response.data.files['jsonp.js'].content );
});
@Khoulaiz
Khoulaiz / check_dyn_hostname
Created August 30, 2013 13:46
check dyndns hostname and reload iptables to reavaluate dynamic hostnames from iptables config. put this in a cronjob and you can use dyndns entries in iptables configs.
#!/bin/bash
# check dyndns name of a host and reset iptables if change was detected
HOSTNAME=<hostname-to-check.dyndns.org>
LOGFILE=/var/run/check_home_ip
Current_IP=$(/usr/bin/dig +short $HOSTNAME)
if [ $LOGFILE = "" ] ; then
iptables-restore </etc/iptables_rules
@lossendae
lossendae / timer.js
Created January 16, 2014 11:49
AngularJS timer with pause
var Controller = function($timeout){
var timer = 10000;
$scope.remaining = timer / 1000;
$scope.startTimer = function(){
$scope.timeout = $timeout(function() {
$scope.remaining--;
$scope.remaining > 0 ? $scope.startTimer() : $scope.finished('Finished!');
}, 1000);
};
@soheilhy
soheilhy / nginxproxy.md
Last active May 16, 2024 08:59
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@Kreshnik
Kreshnik / PreventReplayAttack.php
Last active March 29, 2022 11:00
Laravel 5 - PreventReplayAttack Middleware
<?php namespace App\Http\Middleware;
use Carbon\Carbon;
use Closure;
use Illuminate\Cache\Repository as Cache;
use Illuminate\Support\Facades\Response;
use Illuminate\Support\Facades\Session;
class PreventReplayAttack
{
@teepluss
teepluss / .bowerrc
Last active August 10, 2018 08:20
Config "AdminLTE" with Laravel Elixir
{
"directory": "./resources/assets/vendor"
}
@frankyonnetti
frankyonnetti / css-remove-hover-on-touch-screen-devices.css
Last active March 31, 2024 09:09
CSS - remove :hover on touch screen devices #css #ios
/*
* http://www.javascriptkit.com/dhtmltutors/sticky-hover-issue-solutions.shtml
* Method 3- Using CSS Media Queries Level 4 Interaction Media Features
*/
@media (hover:none),
(hover:on-demand) {
nav a:hover {
/* suppress hover effect on devices that don't support hover fully */
background: none;
pipeline {
agent any
stages {
stage('Prepare') {
steps {
sh 'composer install'
sh 'rm -rf build/api'
sh 'rm -rf build/coverage'
sh 'rm -rf build/logs'