Skip to content

Instantly share code, notes, and snippets.

@weshouman
weshouman / oop knowledge.md
Last active June 23, 2016 04:19
sparse materials, for curious ppl and interview seekers

#how do we know object type in runtime :? that could be if: the language support RTTI

##type introspection figuring the metadata at runtime
https://en.wikipedia.org/wiki/Type_introspection

##C++ specific ###dynamic_cast way: Dynamic cast an object to a class, do we get a bad_cast exception, then it's not the right type

@weshouman
weshouman / day 1.md
Last active October 28, 2017 06:39
command of the day series #study #vcs
git show revision:path/to/file  

shows the file path/to/file at a certain version.
ref: http://stackoverflow.com/a/338470

examples

check the file before the changes that are not commited yet

git show HEAD:app/models/event.rb
@weshouman
weshouman / splitting into files.md
Last active October 28, 2017 06:39
some experience in compiling cpp code #study #cpp

C++ splitting

forward declaration and header inclusion

This is what happens when we forward declare without including the header file that includes the type
It sounds there are no way out of circular includes, thus comes the perks of having #ifndef, #define and #endif wrapping all our headers
For the current project, forward declaration is used in the header files to let the classes know about others' existence and later the header files are included in the cpp files
The forward declaration error means we have found a forward declared class yet the class declaration itself wasn't found

voxelmon.cpp: In member function ‘void Voxelmon::initialize_daycarestate_special()’:
voxelmon.cpp:53:23: error: invalid use of incomplete type ‘class CHILD’
 current = new CHILD();
@weshouman
weshouman / Ruby On Rails insights.md
Created June 27, 2016 11:12
Ruby on Rails study stuff
@weshouman
weshouman / bower managed frontend packages in rails.md
Last active August 6, 2016 14:25
Front end development notes

Install Bower

Install bower on the system (required by bower-rails gem)

npm install -g bower

Add Bower to the Gemfile

gem 'bower-rails'
@weshouman
weshouman / Javascript.md
Last active October 28, 2017 06:39
frontend resources for higher understanding #javascript
@weshouman
weshouman / Debugging States.md
Last active August 14, 2016 20:56
angular notes

Transition messages

Following code displays log messages that get fired when state transitions happen,
watch for the error messages, in case any exists, if 404 is found for a requested object
check the templateURL naming the state shows in the developer tools console

Add the following to the html were angular is activated ie: anywhere into index.html.erb given that application.html.erb has angular activated

<script>
@weshouman
weshouman / file_structure.md
Last active January 20, 2017 22:58
Tagaini Jisho Notes

Tagaini Jisho 2 File Structure

project
└──src
  │  tagaini_config.h //main application configurations
  └──core
      │  paths.h // a utility to search for a given filename (extensively used to get db files)
      │  // many other important utilities
      │
 └──gui
@weshouman
weshouman / ruby.md
Last active September 30, 2016 21:56
documenting the html list to redis app

testing using telnet and openssl

HTTP

open the connection

telnet www.google.com 80

make the request

GET /#q=walid HTTP/1.1