Skip to content

Instantly share code, notes, and snippets.

@crittermike
crittermike / App.js
Last active May 9, 2022 08:18
Using Google API (gapi) with React
/* global gapi */
const API_KEY = 'YOURAPIKEYHERE';
import React, { Component } from 'react';
class App extends Component {
loadYoutubeApi() {
const script = document.createElement("script");
@JamieMason
JamieMason / es6-compose.md
Last active May 17, 2022 17:38
ES6 JavaScript compose function

ES6 JavaScript Compose Function

Definition

const compose = (...fns) =>
  fns.reduceRight((prevFn, nextFn) =>
    (...args) => nextFn(prevFn(...args)),
    value => value
 );
@JoaquimLey
JoaquimLey / github_multiple-accounts.md
Last active April 30, 2023 22:17
How to Work with GitHub and Multiple Accounts

Step 1 - Create a New SSH Key

We need to generate a unique SSH key for our second GitHub account.

ssh-keygen -t rsa -C "your-email-address"

Be careful that you don't over-write your existing key for your personal account. Instead, when prompted, save the file as id_rsa_COMPANY. In my case, I've saved the file to ~/.ssh/id_rsa_work.

Step 2 - Attach the New Key

@3rn3st0
3rn3st0 / Preferences.sublime-settings
Last active March 29, 2018 05:36
Configuraciones de ST3
{
"added_words":
[
"Tabulaciones",
"tabulación",
"Inicializa",
"Apache",
"3rn3st0"
],
"caret_extra_bottom": 3,
@rmoorman
rmoorman / babelrc-vs-webpack-babel-loader-configuration.md
Created July 30, 2016 16:54
.babelrc vs webpack babel-loader configuration

Either you use .babelrc to specify environment specific settings (plugins or transforms for example) using the env key:

{
  "presets": ["es2015", "stage-0", "react"],
  "env": {
    "development": {
      "plugins": [
        ["transform-object-rest-spread"],
 ["transform-react-display-name"],
@robinrendle
robinrendle / browsersync-webpack.md
Last active February 27, 2024 12:04
Getting set up with Browsersync and Webpack

Fixing our local environment with Browsersync

Whenever we change our templates we still have to use our build script and this can get annoying. Thankfully with webpack-dev-server and BrowserSync we can fix this:

npm i -D browser-sync browser-sync-webpack-plugin webpack-dev-server

BrowserSync will act like a proxy, waiting for webpack to do its thing and then reloading the browser for us.

@christiangenco
christiangenco / download_egghead_videos.md
Last active January 29, 2024 03:16 — forked from ldong/download_egghead_videos.md
download egghead videos
@MiguelCastillo
MiguelCastillo / bind.js
Last active May 28, 2023 12:20
Bind polyfill
/**
* Function bind polyfill
* https://github.com/ariya/phantomjs/issues/10522
*/
if (!Function.prototype.bind) {
Function.prototype.bind = function (context /* ...args */) {
var fn = this;
var args = Array.prototype.slice.call(arguments, 1);
@joelstein
joelstein / _mixins.scss
Last active February 1, 2017 13:33
Horizontal list mixins
// Standard horizontal list, using word-spacing trick to remove whitespace
// between inline-block elements.
@mixin horizontal-list {
padding: 0;
text-align: center;
word-spacing: -1em;
display: table;
width: 100%;
li {
@paambaati
paambaati / upload_demo_html.html
Last active March 28, 2021 14:55
Uploading files using NodeJS and Express 4
<html>
<body>
<form action="/upload" enctype="multipart/form-data" method="post">
<input type="text" name="title">
<input type="file" name="file">
<input type="submit" value="Upload">
</form>
</body>
</html>