Monday, December 31, 2018
Sunday, December 30, 2018
Thursday, December 27, 2018
Linux: Prevent SSH timeout
https://bjornjohansen.no/ssh-timeout
In ~/.ssh/config add the following line:
ServerAliveInterval 30
This will send a “null packet” every 30 seconds on your SSH connections to keep them alive.
Wednesday, December 26, 2018
Friday, December 21, 2018
Thursday, December 20, 2018
Wednesday, December 19, 2018
Monday, December 17, 2018
Friday, December 14, 2018
Javascript - this, bind, call
// this , bind, call
var msg = "global";
function f(x){
console.log(this.msg + "," + x);
}
var obj1 = {
msg: "obj1",
f: f
}
var obj2 = {
msg: "obj2"
}
f(10);
obj1.f(10);
f.call(obj2, 10);
// f.call(window, 10);
// f.call(obj1, 10);
// f.call(obj2, 10);
// f.bind(obj1)(10)
// f.bind(obj2)(10)
// f.bind(window)(10)
var msg = "global";
function f(x){
console.log(this.msg + "," + x);
}
var obj1 = {
msg: "obj1",
f: f
}
var obj2 = {
msg: "obj2"
}
f(10);
obj1.f(10);
f.call(obj2, 10);
// f.call(window, 10);
// f.call(obj1, 10);
// f.call(obj2, 10);
// f.bind(obj1)(10)
// f.bind(obj2)(10)
// f.bind(window)(10)
Thursday, December 13, 2018
Wednesday, December 12, 2018
Tuesday, December 11, 2018
Monday, December 10, 2018
Sunday, December 9, 2018
Config in Elixir projects
Excerpt from Elixir Cookbook -
The configuration from the imported files will override any existing configuration (with the same key) in the config.exs file. In fact, Configuration values are merged recursively. See the example at https://github.com/alco/mix-config-example.
To access configuration values, we use Application.get_env(:app, :key).
Friday, December 7, 2018
Thursday, December 6, 2018
Tuesday, December 4, 2018
Saturday, December 1, 2018
AWS Cloud Development Kit
AWS re:Invent 2018: Infrastructure Is Code with the AWS Cloud Development Kit (DEV372)
https://www.reddit.com/r/programming/comments/a22fay/aws_infrastructure_as_code_using_aws_cdk/
Monday, November 26, 2018
Sunday, November 25, 2018
PostgreSQL & Homebrew
https://stackoverflow.com/questions/15301826/psql-fatal-role-postgres-does-not-exist
If you're using postgres from Homebrew, then you want
If you're using postgres from Homebrew, then you want
/usr/local/Cellar/postgresql/9.2.4/bin/createuser -s postgres
(for version 9.2.4, obviously). Saturday, November 24, 2018
Thursday, November 22, 2018
Database Indexes - How to determine if an Index is required or not
https://dba.stackexchange.com/questions/56/how-to-determine-if-an-index-is-required-or-necessary
http://blog.celerity.com/how-to-design-sql-indexes
http://blog.celerity.com/how-to-design-sql-indexes
22/08/2017, 19:03:36B-Trees in databases are not binary trees, they are BALANCED trees
Tuesday, November 20, 2018
UUID related
Seems like an exercise in trying to hack something using UUID guessing -
https://medium.com/@evinsellin/communicating-through-uuid-conflicts-fe50134304db
Labels:
computer science,
web applications
Electron, Desktop PWAs
Medium article:
https://medium.com/dailyjs/goodbye-electron-hello-desktop-pwas-f316b8f39882
YouTube video:
https://medium.com/dailyjs/goodbye-electron-hello-desktop-pwas-f316b8f39882
YouTube video:
Sunday, November 18, 2018
Saturday, November 17, 2018
Sunday, November 11, 2018
Friday, November 9, 2018
Wednesday, November 7, 2018
Database related - Composite Indexes
How do composite indexes work - https://stackoverflow.com/questions/795031/how-do-composite-indexes-work
https://stackoverflow.com/a/795068
https://stackoverflow.com/a/795068
Composite indexes work just like regular indexes, except they have multi-values keys.
If you define an index on the fields (a,b,c) , the records are sorted first on a, then b, then c.
Example:
| A | B | C |
-------------
| 1 | 2 | 3 |
| 1 | 4 | 2 |
| 1 | 4 | 4 |
| 2 | 3 | 5 |
| 2 | 4 | 4 |
| 2 | 4 | 5 |
- 12 Please note also that indexes are stored as Btree, so an (a,b,c) index will help on a search on (a) and on (a, b),
"MySQL can use multiple-column indexes for queries that test all the columns in the index, or queries that test just the first column, the first two columns, the first three columns, and so on. If you specify the columns in the right order in the index definition, a single composite index can speed up several kinds of queries on the same table." - Multiple-Column Indexes – AlikElzin-kilaka Sep 9 at 4:46
https://stackoverflow.com/questions/2349817/two-single-column-indexes-vs-one-two-column-index-in-mysql
https://stackoverflow.com/questions/179085/multiple-indexes-vs-multi-column-indexes?rq=1
https://stackoverflow.com/questions/2349817/two-single-column-indexes-vs-one-two-column-index-in-mysql
https://stackoverflow.com/questions/179085/multiple-indexes-vs-multi-column-indexes?rq=1
Monday, November 5, 2018
Thursday, November 1, 2018
Wednesday, October 31, 2018
Monday, October 29, 2018
Sunday, October 28, 2018
Friday, October 26, 2018
up - tool for writing Linux pipes
https://github.com/akavel/up
up is the Ultimate Plumber, a tool for writing Linux pipes in a terminal-based UI interactively, with instant live preview of command results.The main goal of the Ultimate Plumber is to help interactively and incrementally explore textual data in Linux, by making it easier to quickly build complex pipelines, thanks to a fast feedback loop. This is achieved by boosting any typical Linux text-processing utils such asgrep
,sort
,cut
,paste
,awk
,wc
,perl
, etc., etc., by providing a quick,interactive, scrollable preview of their results.
Internationalization - React vs Angular
https://hackernoon.com/internationalization-in-angular-and-react-applications-a-comparison-93883f4e1cdb
Make sure to read the comments too.
Make sure to read the comments too.
Labels:
Angular,
javascript,
react,
web applications
Thursday, October 25, 2018
Tuesday, October 16, 2018
Erlang 'process'
https://www.quora.com/What-is-the-difference-between-system-threads-and-process-threads-as-in-Java-threads
Excerpt:
Excerpt:
Erlang uses the term "process" because it does not expose a shared-memory multiprogramming model. Calling them "threads" would imply that they have shared memory.
Sunday, October 14, 2018
Saturday, October 13, 2018
Thursday, October 4, 2018
Tuesday, October 2, 2018
Mongo - exporting and importing a single database
On Source Machine
-------------------------
mongo
> show dbs
> exit
mongodump -d abc_xyz_development
(Above command will create a dump/abc_xyz_development folder and put all the files inside it. This folder will need to be zipped and sent to whoever wants to import the database)
On Target Machine
-------------------------
Drop existing database
mongo
> show dbs
> use abc_xyz_development;
> db.dropDatabase();
> exit
Restore from Dump folder:
Command:
mongorestore -d
E.g.
mongorestore -d abc_xyz_development ~/abc_xyz_development
-------------------------
mongo
> show dbs
> exit
mongodump -d abc_xyz_development
(Above command will create a dump/abc_xyz_development folder and put all the files inside it. This folder will need to be zipped and sent to whoever wants to import the database)
On Target Machine
-------------------------
Drop existing database
mongo
> show dbs
> use abc_xyz_development;
> db.dropDatabase();
> exit
Restore from Dump folder:
Command:
mongorestore -d
E.g.
mongorestore -d abc_xyz_development ~/abc_xyz_development
Saturday, September 29, 2018
Wednesday, September 26, 2018
Sunday, September 23, 2018
Friday, September 21, 2018
Thursday, September 20, 2018
Monday, September 17, 2018
Saturday, September 15, 2018
React & JSX related: using JSX without React, minimal setup for trying out React
using JSX without React:
https://itnext.io/lessons-learned-using-jsx-without-react-bbddb6c28561
Minimal React.js Without A Build Step:
https://shinglyu.github.io/web/2018/02/08/minimal-react-js-without-a-build-step-updated.html
https://itnext.io/lessons-learned-using-jsx-without-react-bbddb6c28561
Minimal React.js Without A Build Step:
https://shinglyu.github.io/web/2018/02/08/minimal-react-js-without-a-build-step-updated.html
Thursday, August 30, 2018
Sunday, August 26, 2018
Saturday, August 25, 2018
Sunday, August 19, 2018
Saturday, August 11, 2018
Sunday, July 22, 2018
Subscribe to:
Posts (Atom)
Followers
Blog Archive
-
▼
2018
(194)
-
▼
December
(30)
- Debounce function with args
- Rails related - ActionView helpers in Assets Pipeline
- Linux: Prevent SSH timeout
- Write code that is easy to delete, not easy to ext...
- Realtime Market-Data Updates with Elixir Share this
- Elixir - how to kill a process or make it exit
- Blazor
- Advent of Code - Elixir
- Accessing view helpers in a Rails Console session
- Phoenix LiveView discussion on elixirforum.com
- Morphling - Similar to Phoenix LiveView, Drab
- Difference between MultiCore Programming in Erlang...
- argument solely by appeal to authority
- ES6 - list of some of the new things
- Javascript - this, bind, call
- Elixir - OptionParser
- Phoenix LiveView
- OpenAPI, Postman
- Build a Simple Persistent Key-Value Store in Elixi...
- BEAM
- Elixir Case Studies
- Erlang and Elixir coming to AWS Lambda
- Scoping of html classes (similar to React) in Phoe...
- Config in Elixir projects
- Redux - calling APIs
- About Elixir
- LMAX Disruptor concurrent framework
- React related: API calls when using Redux
- AWS Cloud Development Kit
- Distributed Databases related - Citus & PostgreSQL
-
►
November
(26)
- The Benefits of Materialized Views (and how to use...
- Ruby map, each, collect, inject, reject, select qu...
- Caching strategies in Phoenix
- Rails Performance related: Using nginx as Reverse ...
- PostgreSQL & Homebrew
- Internationalization using Gettext in the Phoenix ...
- memory_profiler for ruby
- C++ book
- Database Indexes - How to determine if an Index is...
- Server-side Swift for Java Developers
- MySQL - importing JSON (and new feature related to...
- Reversing an immutable list
- UUID related
- DoodleMaster - a UI Mocking Tool
- Electron, Desktop PWAs
- Elixir learning resources
- RxJS Reactive Programming
- Virtual Machines and Docker
- gzip, tar
- How to use “grep” command to find text including s...
- MySQL Slow Queries
- Database related - Composite Indexes
- Phoenix related: Future of Drab & LiveView discussion
- Reddit discussion - Let's talk about Phoenix.LiveV...
- Blockchain 2018: Myths vs Reality
- Elixir - How can I schedule code to run every few ...
-
►
October
(17)
- Algorithms related
- Elixir - When to use Elixir language?
- Ruby concurrency related
- labex.io - online courses with virtual environments
- up - tool for writing Linux pipes
- IronDB, EverCookie
- Internationalization - React vs Angular
- Rails: scopes
- Phoenix related - LiveView, Drab, Texas - alternat...
- Erlang 'process'
- Comparison of Erlang Runtime System and Java Virtu...
- Redis use cases
- Why Akka & Java versus Elixir/Erlang
- Elixir Intro
- MySQL: Status variables in MySQL
- react-native-turbolinks
- Mongo - exporting and importing a single database
-
►
August
(8)
- zeu.js - A JavaScript library for real-time visual...
- Infinite Scroll related
- Elixir Umbrella - Microservices or Majestic Monoli...
- Robust Data Processing Pipeline with Elixir and Fl...
- Building videochat with Elixir and Phoenix - Anil ...
- 43:45 / 43:54 Rewriting a legacy application in El...
- Elixir vs Node
- Rails - Consuming local JSON API from another cont...
-
▼
December
(30)
MIPA