Skip to content

Instantly share code, notes, and snippets.

View 0x1ad2's full-sized avatar
👾
01111001 01101111

Dennis Bruijn 0x1ad2

👾
01111001 01101111
View GitHub Profile
@0x1ad2
0x1ad2 / Gulpfile.js
Last active January 23, 2020 15:24
My gulpfile example for How to enhance your front-end development workflow using Gulp
/*
* 0x1ad2 base Gulp.js file
* https://twitter.com/0x1ad2
*/
/*
* Define plugins
*/
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
@0x1ad2
0x1ad2 / Package.json
Created September 14, 2015 13:22
My package.json that is used in combination with my gulpfile
{
"devDependencies": {
"gulp-autoprefixer": "^3.0.1",
"gulp-concat": "^2.6.0",
"gulp-cssbeautify": "^0.1.3",
"gulp-csslint": "^0.2.0",
"gulp-jsbeautifier": "^1.0.1",
"gulp-jshint": "^1.11.2",
"gulp-less": "^3.0.3",
"gulp-minify-css": "^1.2.1",
@0x1ad2
0x1ad2 / countries.php
Last active July 21, 2022 13:09
PHP Dutch countries Array
<?php
return [
"AF" => "Afghanistan",
"AX" => "Åland",
"AL" => "Albanië",
"DZ" => "Algerije",
"VI" => "Amerikaanse Maagdeneilanden",
"AS" => "Amerikaans-Samoa",
"AD" => "Andorra",
@0x1ad2
0x1ad2 / languages.php
Created December 3, 2015 08:38
PHP Dutch languages array
<?php
return [
"abk" => "Abchazisch",
"ada" => "Adangme",
"ady" => "Adygees",
"orm" => "Afaan Oromo",
"aar" => "Afar",
"afh" => "Afrihili",
"afr" => "Afrikaans",
Verifying that +0x1ad2 is my blockchain ID. https://onename.com/0x1ad2
@0x1ad2
0x1ad2 / mutator.php
Last active May 12, 2016 12:13
Dutch date mutator eloquent model
<?php
/**
* Get created at attribute and mutate to Dutch format and Dutch timezone
*/
public function getCreatedAtAttribute($date)
{
return \Carbon::createFromFormat('Y-m-d H:i:s', $date)->copy()->tz('Europe/Amsterdam')->format('d-m-Y H:i:s');
}
@0x1ad2
0x1ad2 / tabs.service.ts
Last active January 15, 2019 00:06
A service to hide and show tabs in Ionic 2
import {Injectable} from '@angular/core';
// Declare TabsService as a provider in app.module.ts
// Inject TabsService in your class: constructor(public tabs: TabsService){}
// Use the this.tabs.hide() or this.tabs.show() methods wherever you want
@Injectable()
export class TabsService {
constructor() {}
public hide() {
@0x1ad2
0x1ad2 / MyHttpPostMethod.ts
Last active March 8, 2017 08:57
HTTP GET example Angular
import {Headers, Http, Response} from "@angular/http";
export class GenericClass {
constructor(public http: Http) {}
public MyHttpPostMethod() {
// create a new promise and resolve it if possible
return new Promise((resolve) => {
#! /usr/bin/env node
// will tell shell enviroment which program it needs execute this, in our case it's node
// always run your code in strict mode
"use strict";
console.log(`My first Node CLI app 🎉`);
// make a list of frequently used binaries
const frequentlyUsedBinaries = [
"iterm2",
"visual-studio-code",
"google-chrome",
"zsh",
"whatsapp",
"spectacle",
"spotify",
"slack",