Skip to content

Instantly share code, notes, and snippets.

View kcmr's full-sized avatar

Kus Cámara kcmr

View GitHub Profile
@samthor
samthor / safari-nomodule.js
Last active February 14, 2024 02:54
Safari 10.1 `nomodule` support
// UPDATE: In 2023, you should probably stop using this! The narrow version of Safari that
// does not support `nomodule` is probably not being used anywhere. The code below is left
// for posterity.
/**
* Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will
* load <script nomodule> anyway. This snippet solve this problem, but only for script
* tags that load external code, e.g.: <script nomodule src="nomodule.js"></script>
*
* Again: this will **not** prevent inline script, e.g.:
1. Setup a project
2. Add groovy SDK support:
https://www.bonusbits.com/wiki/HowTo:Add_Groovy_SDK_to_IntelliJ_IDEA
3. Download http://(yourjenkinsurl)/job/(yourpipelinejob)/pipeline-syntax/gdsl
- this will give you the .gdsl file - download this to the src folder of your project.
4. Finally follow this step - right click on the src folder -> Mark directory as -> Sources Root
@ef4
ef4 / travis.yml
Created December 6, 2016 19:45
Example of ember-cli-deploy from travis
deploy:
- provider: script
skip_cleanup: true
script: node_modules/.bin/ember deploy development --activate --verbose
on:
branch: master
- provider: script
skip_cleanup: true
script: node_modules/.bin/ember deploy staging --activate --verbose
on:
@razbomi
razbomi / gulpfile.js
Created November 16, 2016 23:19
Gulp pipe function
'use strict';
var gulp = require('gulp');
var through = require('through2');
// https://gulp.readme.io/docs
gulp.task('default', () => {
gulp.src('src/**/*')
.pipe(pipeFunction())
.pipe(gulp.dest('dist'))
import sinonStubPromise from 'sinon-stub-promise';
import sinon from 'sinon'
sinonStubPromise(sinon)
let stubedFetch = sinon.stub(window, 'fetch') )
window.fetch.returns(Promise.resolve(mockApiResponse()));
function mockApiResponse(body = {}) {
@jonsuh
jonsuh / .bash_profile
Last active February 16, 2024 17:17
Bash echo in color
# ----------------------------------
# Colors
# ----------------------------------
NOCOLOR='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
@paulirish
paulirish / what-forces-layout.md
Last active June 3, 2024 15:29
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@FrancesCoronel
FrancesCoronel / sampleREADME.md
Last active March 26, 2024 01:21
A sample README for all your GitHub projects.

Repository Title Goes Here

Frances Coronel

INSERT GRAPHIC HERE (include hyperlink in image)

Subtitle or Short Description Goes Here

ideally one sentence >

@PurpleBooth
PurpleBooth / README-Template.md
Last active June 2, 2024 14:24
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@lunaroja
lunaroja / browser-sync-settings.js
Created March 19, 2015 22:18
Change BrowserSync Notification Styles
// https://github.com/BrowserSync/browser-sync/issues/141
browserSync({
notify: {
styles: [
'display: none; ',
'padding: 6px 15px 3px;',
'position: fixed;',
'font-size: 0.8em;',
'z-index: 9999;',
'left: 0px;',