Skip to content

Instantly share code, notes, and snippets.

Avatar
💚
working with tegridy

Filippo Conti b4dnewz

💚
working with tegridy
View GitHub Profile
@b4dnewz
b4dnewz / Dockerfile
Last active Jan 30, 2019
An extended WordPress image designed for easy and fast development.
View Dockerfile
# 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 Jan 24, 2019
A VueJs custom directive to stick an element where it is keeping it into view
View v-scroll-fixed.directive.js
/**
* 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 Apr 17, 2018
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
View scan-subnet.sh
#!/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 Aug 15, 2017
Angular filter to include items that belong to a given array by array element value or optionally by object property value.
View inarray.coffee
'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 Aug 10, 2017
Sass Media Queries: Collection of media queries breakpoint variables written in sass.
View media-queries.scss
/**
* 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 Aug 4, 2017
Angular directive to fire callback on element load.
View ngload.coffee
'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 Jul 12, 2017
Angular filter to exclude items that belong to a given array.
View notinarray.coffee
'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 Jul 6, 2017
Angular filter to limit string based on words count.
View limitwords.coffee
'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 Jul 6, 2017
Angular directive to validate input based on maximum words length.
View ngmaxwords.coffee
'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 Jul 6, 2017
Angular directive to validate input based on minimum words length.
View ngminwords.coffee
'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', ->