Skip to content

Instantly share code, notes, and snippets.

View b4dnewz's full-sized avatar
💚
working with tegridy

Filippo Conti b4dnewz

💚
working with tegridy
View GitHub Profile
@b4dnewz
b4dnewz / Dockerfile
Last active January 30, 2019 12:24
An extended WordPress image designed for easy and fast development.
# WordPress Development
# An custom container extended with development tools
#
# Usage: docker build .
# docker build --build-arg VERSION=4.9 .
# docker build --build-arg USERID=$(id -u) .
ARG VERSION=latest
FROM wordpress:$VERSION
@b4dnewz
b4dnewz / v-scroll-fixed.directive.js
Last active January 24, 2019 14:24
A VueJs custom directive to stick an element where it is keeping it into view
/**
* Directive to stick an element where it is
* when the scroll should pass him instead
*
* Just copy and paste this code inside your app
* main script before Vue is initialized and you
* have access to the directive as v-scroll-fixed
*
* @version 0.1.0
* @author Filippo b4dnewz Conti
@b4dnewz
b4dnewz / scan-subnet.sh
Last active April 17, 2018 00:29
A useful bash script to launch once connected in a new network to know your address, the subnet size and launch a nmap scan to the rest of the network to find out who is connected
#!/bin/bash
# The interface from which to take the address and subnet
interface=${1:-"wlan0"}
# Get the nmap scan flags from second argument that must be enclosed with quotes
scanFlags=${2:-"-n -sn"}
# The full ipv4 address with subnet
fullAddr=$(ip addr show $interface | grep -w inet | awk '{print $2}')
@b4dnewz
b4dnewz / inarray.coffee
Created August 15, 2017 20:51
Angular filter to include items that belong to a given array by array element value or optionally by object property value.
'use strict'
###*
# @ngdoc filter
# @name app.filter:inArray
# @description Angular filter to include items that belong to a given array
# by array element value or optionally by object property value.
# # inArray
###
angular.module 'app'
@b4dnewz
b4dnewz / media-queries.scss
Created August 10, 2017 22:21
Sass Media Queries: Collection of media queries breakpoint variables written in sass.
/**
* Sass-Ready media queries
* Here there are some presets of useful
* media queries breakpoints for various devices
* Usage: @media #{variable-name} { }
* and it will compile to: @media variable-name { }
*
*/
// Devices
@b4dnewz
b4dnewz / ngload.coffee
Created August 4, 2017 20:45
Angular directive to fire callback on element load.
'use strict'
###*
# @ngdoc directive
# @name app.directive:ngLoad
# @description Angular directive to fire callback on element load.
# # ngLoad
###
angular.module 'app'
.directive 'ngLoad', ($parse) ->
@b4dnewz
b4dnewz / notinarray.coffee
Created July 12, 2017 11:57
Angular filter to exclude items that belong to a given array.
'use strict'
###*
# @ngdoc filter
# @name app.filter:notInArray
# @description Angular filter to exclude items that belong to a given array.
# # notInArray
###
angular.module 'app'
.filter 'notInArray', ($filter) ->
@b4dnewz
b4dnewz / limitwords.coffee
Created July 6, 2017 14:24
Angular filter to limit string based on words count.
'use strict'
###*
# @ngdoc filter
# @name app.filter:limitWords
# @description Angular filter to limit string based on words count.
# # limitWords
###
angular.module 'app'
.filter 'limitWords', ->
@b4dnewz
b4dnewz / ngmaxwords.coffee
Created July 6, 2017 14:18
Angular directive to validate input based on maximum words length.
'use strict'
###*
# @ngdoc directive
# @name app.directive:ngMaxwords
# @description Angular directive to validate input based on maximum words length.
# # ngMaxwords
###
angular.module 'app'
.directive 'ngMaxwords', ->
@b4dnewz
b4dnewz / ngminwords.coffee
Created July 6, 2017 14:17
Angular directive to validate input based on minimum words length.
'use strict'
###*
# @ngdoc directive
# @name app.directive:ngMinwords
# @description Angular directive to validate input based on minimum words length.
# # ngMinwords
###
angular.module 'app'
.directive 'ngMinwords', ->