Skip to content

Instantly share code, notes, and snippets.

View rodush's full-sized avatar
👷‍♂️
building web applications

Roman Dushko rodush

👷‍♂️
building web applications
View GitHub Profile
@rodush
rodush / enzyme_render_diffs.md
Created April 25, 2018 07:53 — forked from fokusferit/enzyme_render_diffs.md
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • render
@rodush
rodush / protips.js
Created March 29, 2018 23:38 — forked from nolanlawson/protips.js
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");
@rodush
rodush / gist:d5ee54b44958f8eb06d1ade4dc701bf1
Created January 18, 2018 13:07
AWS S3 Cloudfront deployment Gulp Task
gulp.task('deploy', function(cb) {
var publisher = $.awspublish.create(aws);
var headers = {'Cache-Control': 'max-age=315360000, no-transform, public'};
return gulp.src('dist/**')
.pipe($.awspublish.gzip())
.pipe(publisher.publish(headers))
.pipe(publisher.cache())
.pipe($.awspublish.reporter())
.pipe($.cloudfront(aws))
.on('end', function() {
<script name="tophatvariables">
email="mostafa@tophat.com"
username="mostafaprof"
userFirstName="Mostafa"
userLastName="Younis"
</script>
<script type='text/javascript' src='https://c.la4-c2-was.salesforceliveagent.com/content/g/js/37.0/deployment.js'></script>
@rodush
rodush / ngrxintro.md
Created March 7, 2017 22:59 — forked from btroncone/ngrxintro.md
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

#Comprehensive Introduction to @ngrx/store By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@rodush
rodush / golang-tls.md
Created January 31, 2017 14:56 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
openssl ecparam -genkey -name secp384r1 -out server.key
@rodush
rodush / gist:0b3d61c0343965b9bf5c
Created December 18, 2015 13:30 — forked from tonymtz/gist:d75101d9bdf764c890ef
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
# go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
  • 🎨 when improving the format/structure of the code
  • 🚀 when improving performance
  • ✏️ when writing docs
  • 💡 new idea
  • 🚧 work in progress
  • ➕ when adding feature
  • ➖ when removing feature
  • 🔈 when adding logging
  • 🔇 when reducing logging
  • 🐛 when fixing a bug
mike@rbci:~$ psql -U postgres
psql (9.0.3)
Type "help" for help.
postgres=# update pg_database set datallowconn = TRUE where datname = 'template0';
UPDATE 1
postgres=# \c template0
You are now connected to database "template0".
template0=# update pg_database set datistemplate = FALSE where datname = 'template1';
UPDATE 1
require.config({
baseUrl: '/backbone-tests/',
paths: {
'jquery' : '/app/libs/jquery',
'underscore' : '/app/libs/underscore',
'backbone' : '/app/libs/backbone',
'mocha' : 'libs/mocha',
'chai' : 'libs/chai',
'chai-jquery' : 'libs/chai-jquery',
'models' : '/app/models'