Skip to content

Instantly share code, notes, and snippets.

View erkobridee's full-sized avatar

Erko Bridee erkobridee

View GitHub Profile
  1. Instale as dependências:
yarn add webpack babel-core babel-loader babel-preset-env
  1. Crie o arquivo de configuração do webpack:
touch webpack.config.js
@willgm
willgm / app.component.spec.ts
Created September 4, 2017 21:35
Speed up your component's test suite by caching the test module
import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';
import { setUpCachedTestBed } from '../test-utils';
describe('AppComponent', () => {
setUpCachedTestBed({
declarations: [ AppComponent ],
});
beforeEach(() => {

Walkthrough of the following script (v8:6573).

var logFoo;
var promise1 = Promise.resolve().then( () => logFoo = () => console.log( "foo" ) );
promise1.then( () => logFoo() ).then( logFoo );

1. var logFoo;

@nweldev
nweldev / nodejs_installer.ps1
Last active April 25, 2023 10:40
Powershell script installing nodejs (with git) and some npm packages
write-host "`n ## NODEJS INSTALLER ## `n"
### CONFIGURATION
# nodejs
$version = "4.4.7-x64"
$url = "https://nodejs.org/dist/latest-v4.x/node-v$version.msi"
# git
$git_version = "2.9.2"
@peteristhegreat
peteristhegreat / git diff sqlite3 .gitattributes
Last active March 25, 2024 12:38
Sqlite git diff - Get git to use an sql dump of sqlite3 for showing differences ( .gitconfig config attributes sqlite3 )
*.db diff=sqlite3
@jonobr1
jonobr1 / google-sheet-to-json.js
Last active April 26, 2024 15:41
A node.js script to convert a Google Sheet into a JSON object
/**
* Simple Node.js script to turn a specific page on a Google Sheet
* into a JSON object for the main purpose of HTML Templating.
*
* @author jonobr1 / http://jonobr1.com
*
*/
var https = require('https');
var path = require('path');
@fdaciuk
fdaciuk / Esconder_console_log.md
Last active September 3, 2021 15:00
Esconder console.log() quando o site for para produção

Esconder console.log() para o site em produção

  • Trocar o www.mywebsite.com pelo endereço do site em produção;
  • Incluir isso no início do seu script.

Se passar o parâmetro ?development na URL, ele ignora e mostra os console.log().

@pbojinov
pbojinov / README.md
Last active December 8, 2023 21:09
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@pauloricardomg
pauloricardomg / cors.nginxconf
Last active March 8, 2024 18:31
Nginx configuration for CORS-enabled HTTPS proxy with origin white-list defined by a simple regex
#
# Acts as a nginx HTTPS proxy server
# enabling CORS only to domains matched by regex
# /https?://.*\.mckinsey\.com(:[0-9]+)?)/
#
# Based on:
# * http://blog.themillhousegroup.com/2013/05/nginx-as-cors-enabled-https-proxy.html
# * http://enable-cors.org/server_nginx.html
#
server {