Skip to content

Instantly share code, notes, and snippets.

View misterhtmlcss's full-sized avatar

Roger Kondrat misterhtmlcss

View GitHub Profile
@johnschimmel
johnschimmel / index.html
Last active September 4, 2021 10:35
Demo of loading Google Maps, fetching Markers with AJAX, Geocoding new location and POSTing new location with AJAX. http://dwd-nodejs-remoteapis.herokuapp.com/
<style>
/* IMPORTANT - must give map div height */
#map-canvas {
height:400px;
}
/* IMPORTANT - fixes webkit infoWindow rendering */
#map-canvas img {
max-width: none;
}
@kerimdzhanov
kerimdzhanov / random.js
Last active June 25, 2024 19:41
JavaScript: get a random number from a specific range
/**
* Get a random floating point number between `min` and `max`.
*
* @param {number} min - min number
* @param {number} max - max number
* @return {number} a random floating point number
*/
function getRandomFloat(min, max) {
return Math.random() * (max - min) + min;
}
@mikaelbr
mikaelbr / destructuring.js
Last active April 25, 2024 13:21
Complete collection of JavaScript destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@jordanpoulton
jordanpoulton / pair_programming_roles
Last active May 28, 2024 12:34
Pair Programming Role Definitions - Driver:Navigator
Driver:
-Write the code according to the navigator's specification
-Listen intently to the navigators instructions
-Ask questions wherever there is a lack of clarity
-Offer alternative solutions if you disagree with the navigator
-Where there is disagreement, defer to the navigator. If their idea fails, get to failure quickly and move on
-Make sure code is clean
-Own the computer / keyboard
-Ignore larger issues and focus on the task at hand
-Trust the navigator - ultimately the navigator has the final say in what is written
@diegoliv
diegoliv / gulpfile.js
Created May 14, 2015 17:31
gulpfile.js for building e-mail templates
var gulp = require( 'gulp' ),
sass = require( 'gulp-sass' ),
autoprefixer = require( 'gulp-autoprefixer' ),
minifycss = require( 'gulp-minify-css' ),
imagemin = require( 'gulp-imagemin' ),
rename = require( 'gulp-rename' ),
concat = require( 'gulp-concat' ),
plumber = require( 'gulp-plumber' ),
notify = require( 'gulp-notify' ),
inlineCss = require('gulp-inline-css'),
@AaronPhalen
AaronPhalen / basic_vim_commands.md
Last active December 14, 2023 17:02
Useful Vi Editor Commands

Author: Aaron Phalen | Twitter: @aaron_phalen | Email: aaronphalen@gmail.com

#Useful Vi Editor Commands

  1. :w --> save to a file
  2. :q --> quit out of editor file
  3. :q! --> quit out of editor without saving file
  4. w --> move one word forward at a time in file
  5. b --> move one word back at a time in file
  6. :wq --> save file and quit editor
@itsdevcoffee
itsdevcoffee / .js
Created January 16, 2017 07:13
Vue.js Tutorial - Posts
[
new Post(
'Vue.js',
'https://vuejs.org/',
'Chris',
'https://vuejs.org//images/logo.png'
),
new Post(
'React.js',
'https://facebook.github.io/react/',
@mrispoli24
mrispoli24 / setting-up-heroku-and-cloudflare.md
Created October 15, 2018 18:41
Setting up Heroku and Cloudflare (the right way)

Setting up Heroku and Cloudflare (the right way)

The following outlines how to setup Heroku + Cloudflare with a full SSL certificate. What this means is that communication between the browser and the Cloudflare CDN is encrypted as well as communication between Cloudflare and Heroku’s origin server. Follow these steps exactly and the setup is a breeze.

Step 1: Set up domain names in Heroku

First you want to add the root domain and the www domain to heroku. You do this by clicking into your production application, then going to settings and then scrolling down to Domains and certificates.

Here you will add <your_domain>.com and www.<your_domain>.com. This will give you two CNAME records. They will look something like <your_domain>.com.herokudns.com and www.<your_domain>.com.herokudns.com.

Step 2: Add CNAME records to Cloudfare.

These are generic npm scripts that you can copy & paste into your package.json file as-is and get access to convinience scripts to manage your Docker images all in one place.

Looking for npm scripts for AWS ECS? Go here!

Watch the video: Do More With Less JavaScript

Docker Containers for Static or Angular/React/Vue/etc SPA Websites