Skip to content

Instantly share code, notes, and snippets.

View 1forh's full-sized avatar
🎯
Focusing

1forh

🎯
Focusing
View GitHub Profile
@daubattu
daubattu / index.vue
Created August 11, 2020 07:57
How to push notification in NuxtJS with Firebase Cloud Messaging
<template></template>
<script>
import firebase from '../plugins/firebase';
export defautl {
created() {
const messaging = firebase.messaging();
messaging
.requestPermission()
.then(() => {
@ThatGuySam
ThatGuySam / allowed-block-types.php
Last active October 31, 2023 08:06
Limit allowed Gutenberg Blocks with full list of native Wordpress Blocks
<?php
// Hook up function to allowed_block_types filter
add_filter( 'allowed_block_types', 'set_allowed_block_types' );
/**
* Set allowed gutenburg block types
* https://rudrastyh.com/gutenberg/remove-default-blocks.html
*/
@merlosy
merlosy / README.md
Last active May 22, 2021 22:13
Angular 4+ Material input field

Angular Material - File Upload field

  • Compatible with model driven validation (Reactive forms)
  • tested on Angular Material Beta 12
  • Implemented with Angular 4.4.x

For easier maintaining, I moved all sources on Plunker: SEE LIVE DEMO ON PLUNKER

Note: Getting the model value, returns an FileInput object (type FileInput)

@StephenFluin
StephenFluin / upload.component.ts
Created October 3, 2016 20:30
Firebase Uploader Component with Angular 2
import { Component, Input } from '@angular/core';
import { Router } from '@angular/router';
import { AngularFire, FirebaseListObservable } from 'angularfire2';
import { Observable } from 'rxjs';
declare var firebase: any;
interface Image {
path: string;
@milocosmopolitan
milocosmopolitan / ngrok-installation.md
Last active June 21, 2023 16:31
Install ngrok on Mac OS X El Captin(10.11)

#Installing ngrok on OSX

When you try to install with downloaded zip file from ngrok website, alert message will pop up and tell you "ngrok" can't be opened because it is from an unidentified developer.

You can simply use homebrew to install this without any issue.

  1. Open your terminal
  2. $ brew cask install ngrok
@rcugut
rcugut / node-npm-install.md
Last active February 2, 2024 11:51 — forked from DanHerbert/fix-homebrew-npm.md
Install node & npm on Mac OS X with Homebrew

DEPRECATED as of macOS 10.13 (High Sierra). See the new GUIDE to install nvm and yarn for macOS (updated July 2019)

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

@cmacdonnacha
cmacdonnacha / color-palette.scss
Created April 6, 2016 13:05
Material Design Color Palette
$white: #ffffff;
$black: #000000;
$red50: #ffebee;
$red100: #ffcdd2;
$red200: #ef9a9a;
$red300: #e57373;
$red400: #ef5350;
$red500: #f44336;
$red600: #e53935;
$red700: #d32f2f;
@louim
louim / uploads.yml
Last active December 23, 2022 14:20
Drop-in playbook for Trellis to push and pull uploads from the server to your local machine.
---
- name: Sync uploads between environments
hosts: web
remote_user: "{{ web_user }}"
vars:
project: "{{ wordpress_sites[site] }}"
project_root: "{{ www_root }}/{{ site }}"
tasks:
@patricksurry
patricksurry / README.md
Last active October 12, 2017 15:28 — forked from mbostock/.block
Rolling pan and zoom with Mercator projection

Example illustrating zoom and pan with a "rolling" Mercator projection. Drag left-right to rotate projection cylinder, and up-down to translate, clamped by max absolute latitude. Ensures projection always fits properly in viewbox.

@cobyism
cobyism / gh-pages-deploy.md
Last active May 7, 2024 18:46
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).