Skip to content

Instantly share code, notes, and snippets.

@phund
phund / Why You Should be Using Angular 2.md
Last active February 14, 2017 08:21
Why You Should be Using Angular 2

Written by Joe Eames, Founder, ng-conf (the AngularJS conference)

Angular 2 is just about to release, and many developers are asking themselves, “should I learn Angular 2?” The short answer is yes, but we’ll look at some of the reasons why.

First, it’s a good idea to understand where front end web development is at currently. A few short years ago, there were very few choices, but today, we have quite a few very good frameworks to choose from. This is a better situation than when there were no choices, but it can also lead to analysis paralysis, where we can’t make a decision because there’s just too many good choices. In addition, we have seen a recent rash of tool fatigue - developers complaining that there is just too many moving pieces in even a simple app, and for new developers especially, this can be a particularly challenging environment in which to try to get work done.

Angular 1

Although Angular 1 is a great framework, it’s beginning to show its age. Even though it is still gaining popularity,

@phund
phund / TypeScript and Angular 2.md
Created February 14, 2017 08:20
TypeScript and Angular 2

Written by Joe Eames, Creator of 18 Pluralsight courses & ng-conf

One of the very common surprises that people have when learning about Angular 2 is its close ties with TypeScript. This relationship seemingly came out of nowhere, and many people have been asking questions about this. Additionally, developers may feel a little trepidation when faced with learning yet again something new. So let’s get a quick look at not only the rationale, but the absolute basics and how much of an additional learning curve TypeScript might add when learning Angular 2.

History It’s easier to understand the present by understanding the past. When the Angular team started on Angular 2, they realized that with such a large undertaking, that having types would eliminate a large segment of possible bugs as they wrote the code for the framework. So internally they were interested in adding types to JavaScript. Furthermore, the dependency injection system of Angular 2 works better with types. So there was a good reason to use type

@phund
phund / tip_every_day.md
Last active February 22, 2017 09:34
Tip every day
  1. Delete merged branchs (local)
git branch --merged master | grep -v "\* staging" | xargs -n 1 git branch -d
@phund
phund / Installing Graphics Magic
Created March 30, 2017 09:59 — forked from abernardobr/Installing Graphics Magic
How to install Graphics Magick
## On Windows:
``http://www.graphicsmagick.org/INSTALL-windows.html``
## On the Mac:
``brew install graphicsmagick``
## On the Joyent box:
```

FWIW: I didn't produce the content present here. I've just copy-pasted it from somewhere over the Internet, but I cannot remember exactly the original source. I was also not able to find the author's name, so I cannot give him/her the proper credit.


Effective Engineer - Notes

What's an Effective Engineer?

@phund
phund / benchmark.rb
Created July 19, 2018 08:29 — forked from hakanensari/benchmark.rb
PostgreSQL update strategies in and around Rails
require 'active_record'
require 'activerecord-import'
require 'benchmark'
require 'pg'
include ActiveRecord
Base.establish_connection adapter: 'postgresql',
encoding: 'unicode',
pool: 5,
@phund
phund / pgsql-query-json-array.sql
Created July 19, 2018 10:22 — forked from clarkdave/pgsql-query-json-array.sql
(PostgreSQL) Query something in a JSON array in a WHERE clause
-- when you have a record which looks like this
--
-- id: 5,
-- properties: {
-- ages: [20, 30]
-- }
--
-- it is a bit of a pain if you need to query based on the contents of the "ages" array inside the JSON object "properties"
-- because PG currently lacks easy to use operators to work with JSON arrays
@phund
phund / .rvmrc
Created August 27, 2018 06:30 — forked from danielnc/Gemfile
Ruby-based Benchmark of MessagePack vs. JSON vs. Yajl vs. Protobuffers vs. MultiJson vs. Marshal vs. YAML vs. BSON
rvm --create 1.9.3@benchmarks
@phund
phund / ab.sh
Created September 21, 2018 10:32 — forked from hassansin/ab.sh
Apache Bench Ajax POST
ab \
-n 1000 \
-c 20 \
-s 30 \
-p post-data.txt \
-T 'application/x-www-form-urlencoded; charset=UTF-8' \
-v 3 \
-H "X-Requested-With: XMLHttpRequest" \
-H "X-Ajax-Referer: http://example.com" \
-H "Accept-Encoding: gzip, deflate" \
@phund
phund / gist:cf5e0a9561cbd7ecc55a66b21b967152
Last active July 8, 2019 09:59
Rake task check syntax in a Rails app.
namespace :syntax do
desc 'Checks the syntax of ERB files'
task :erb do
require 'action_view'
puts "Start check ERB files: "
errors = []
Dir['app/views/**/*.erb'].each do |file|
template = File.read(file)