Skip to main content

Posts

Showing posts from March, 2017

'cookie' => 'xxxx.com'

up vote 4 down vote accepted The problem was this line: 'cookie' => 'xxxx.com', in session.php. Apparently it loses the cookie if you have a "." in the cookie name. I can't believe Laravel doesn't like that. Or maybe it's browser's in general. https://en.wikipedia.org/wiki/List_of_HTTP_header_fields http://shiflett.org/blog/2011/mar/php-session-debugging Some note here

PHP Session timeout, Apache, Laravel

Apache (PHP ?) default session handling is not reliable. So this is why we have to better implement your-own time-out mechanism. http://stackoverflow.com/questions/520237/how-do-i-expire-a-php-session-after-30-minutes/1270960#1270960 http://stackoverflow.com/questions/1516266/how-long-will-my-session-last Session best practice in security  https://martinfowler.com/articles/web-security-basics.html#ProtectUserSessions Update later... http://security.stackexchange.com/questions/18880/do-you-need-to-encrypt-session-data http://stackoverflow.com/questions/6185135/session-survives-browser-close-should-i-want-to-prevent-this

Select2

                 setTimeout(function () {                      $('#slPersonId').select2({                          placeholder: "Select Person to Add",                          theme: 'default',                          dropdownAutoWidth: 'true',                          data: function() { return {results: $scope.listPerson}; }                      });                  }, 1000);

Window + X

Trong các bản win trước muốn vô command admin thì hay dùng Right Click open as Administrator... Win 8, 10 éo được (vẫn permission err). Hóa ra có Win-X

SVN work flow complex source code version

http://stackoverflow.com/questions/3816626/deleting-an-svn-branch http://svnbook.red-bean.com/en/1.5/svn.tour.importing.html#svn.tour.importing.layout svn cat -r 27343 js/controllers/Money/BurnMoneyCtrl.js svn cat -r rev_number file_path Mấy lệnh check out version cũ cho 1 file trong SVN như shit éo hiêu sao ko chạy. svn log -v to show all path change in commit (all file change/added ...) WTF http://stackoverflow.com/questions/16787065/svn-log-not-showing-all-recent-commits The problem had to do with my poor understanding of what svn log was showing. With no other arguments supplied, it outputs log messages from the working copy of the log, not from the actual repository. Thus, issuing svn update will bring the working copy up-to-date with the repository, and then svn log will reflect all recent commits. Duh! ;-) Run svn log on command line (GitBash) do not show all recent commits. So I very worry about a big problem has been happened. Fortunately, svn show ok on GUI.

SVN reduce .svn folder size

If the used disk space is more important for you than the version history, then you could make a clean checkout and reimport your projects into a new repository. The old repositories could then be stored in a compressed archive. If you don't want to lose the complete history, then this article might be interesting for you: Delete parts of subversion history

ionic iOS simple decode

Simple ionic app (without code  obfuscation) can be easily extract ipa file using tar or unzip. Result is full source code. Using iTune download app. Go to app folder (googling) copy ipa file. Then using tar -xf file.ipa. Source code in result (you can check size of folder to get right thing). I using Mac Mini OSX, may be iTune on Windows can download ipa ?

Windows tasklist and sort result

tasklist run on git-bash vs on CMD tasklist /M not run on git-bash sample output (after kill Forxit connect and quit Slack) (Win 8 x64 core i3 2100, 10GB memory) Slack (idle) eat about 150MB Foxit connect eat about 130MB (on TaskMgr only show 3MB :) ) To dump tasklist to file, run: tasklist > tasklist.out ">" mean redirect output to file instead of cmd console. If use ">>" mean new data (text) will append instead of replace old data in file. sort -k5 mean sort output by column #5 $ sort -k5 -n tl_simple.out ========================= ======== ================ =========== ============ Image Name                     PID Session Name        Session#    Mem Usage System Idle Process              0 Services                   0          4 K smss.exe                       308 Services                   0        336 K wininit.exe                    468 Services                   0        592 K conhost.exe                    160 Console    

HTTP 301 302

No, they don't use files. When you click on a link like that, an HTTP request is send to their server with the full URL, like http://bit.ly/duSk8wK (links to this question). They read the path part (here duSk8wK), which maps to their database. In the database, they find a description (sometimes), your name (sometimes) and the real URL. Then they issue a redirect, which is a HTTP 302 response and the target URL in the header. This direct redirect is important. If you were to use files or first load HTML and then redirect, the browser would add TinyUrl to the history, which is not what you want. Also, the site that is redirected to will see the referrer (the site that you originally come from) as being the site the TinyUrl link is on (i.e., twitter.com, your own site, wherever the link is). This is just as important, so that site owners can see where people are coming from. This too, would not work if a page gets loaded that redirects. PS: there are more types of redirect. HTTP 3