Don't wanna be here? Send us removal request.
Text
Desktops: Alternative to OSX's Workspaces for Windows
Thursday - October 15, 2015 at 10:54PM.
I used to do my works in different workspaces (virtual desktop), which is supported by default in OSX. Previously, I was using VirtuaWin which was nice enough for my 14" notebook (Compaq Presario). The pain comes when I use it for my mini machine, Acer Aspire One. It lags, and sometimes just totally unresponsive.
I can't handle the pain anymore, and started googling for the similar program and then I meet this guy: Desktops.
For me, it's a quite simple program, not so many features as other desktop manager but it satisfied my needs. I prefer to navigate between desktops using shortcut, like alt+1 for desktop #1, alt+2 for desktop #2 and so on, up to desktop #4.
In my mini machine, this program only takes ~5K of my ram to run. The executable file itself is only ~61KB.
I also found one nice post about Desktops here : http://www.howtogeek.com/195962/unlock-virtual-desktops-on-windows-7-or-8-with-this-microsoft-tool/.
Want to try?
0 notes
Text
Up and Running with MySQL (Mac)
Tuesday - October 13, 2015 at 3:16 PM
I used MAMP. Installation was pretty easy for Apache/nginx with MySQL. But, I felt that it becomes quite heavy for my machine (Macbook Air 2011). Then I moved to XAMPP. Installation was pretty easy as well. But still, quite heavy for my machine. Tried Docker with Kitematic. Having no problem installing MySQL. But since Docker is using virtualization, it felts heavy on my machine. Now, I'm using native MySQL package.
Download MySQL .dmg file from http://dev.mysql.com/downloads/mysql/
Install the downloaded file. A MySQL panel will be shown in System Preference if installation succeed.
To connect with MySQL, open terminal and type :
/usr/local/mysql/bin/mysql -u root -h localhost -p
Since the password of fresh-installed MySQL is set to blank, we can hit enter when prompted for password.
0 notes
Text
Laravel 5.1: No supported encrypter found
Wednesday - October 14, 2015 at 7:43 AM
I was installing laravel app and when I do php artisan serve, it returns:
No supported encrypter found. The cipher and / or key length are invalid.
I suspect that the issue might because of the cipher used in config/app.php is different with the cipher supported by my mini machine. That cipher was:
'cipher' => 'AES-256-CBC'
which then I changed to:
'cipher' => 'AES-128-CBC'
Since the cipher is changed, I generate new key for that cipher using php artisan key:generate. Let's bring up the server using php artisan serve then visit localhost:8000 and yay it works!
0 notes
Text
'XDM', an Alternative to Internet Download Manager (IDM)
Wednesday - October 14, 2015 at 2:35 AM.
Just a short post, was looking at my friend's notebook and saw him using Xtreme Download Manager (XDM). Seems to be a good alternative to https://www.internetdownloadmanager.com, let's give this XDM a try!
0 notes
Text
Set Default Zoom in Opera (Windows)
Wednesday - October 14, 2015 at 1:11 AM.
The pain is, since I'm using a 10" netbook which max resolution is 1024 x 600, pages in browser aren't nicely cropped. I need to zoom out to 75% to make it looks more fit. I was using chrome, but turns out that it takes too much ram for my low-end machine. Now, i'm giving Opera a try.
In Opera, open settings (alt+p) and click Websites. Change Page zoom to 75%. That's all.
Now, whenever I visit a site, the page zoom will be set to 75% by default, which looks ok on my small machine.
0 notes
Text
My Most-Used Sublime Shortcuts
Tuesday - October 13, 2015 at 01:49:00 AM.
The ctrl key are for Windows OS, and mapped to command key in OSX. To install Sublime package control you can visit https://packagecontrol.io/installation
ctrl-shift-c Display color picker (using ColorPicker)
ctrl-shift-k Delete line
ctrl-alt-n Create new file (using AdvancedNewFile)
ctrl-p Search file in project
ctrl-shift-[arrow up|arrow down] Move line up or down
ctrl-d Select single or more word(s)
ctrl-alt-u Find use of matched class (using php-companion)
Waiting list:
Minify selection
0 notes
Text
Shophouse, The Social Hostel (Singapore)
Thursday - October 15, 2015 at 7:36 PM.
We wanted to see our Singaporean friends. We headed from Malaysia to Singapore using Jetstar. Quite a cheap flight, MYR 60 for each person.
Having dinner at Causeway Point food court, not bad. Steamed rice chicken for SGD 4.5 and teh tarik (milk tea) for SGD 1.
My friend stays at his house, and I stay in backpackers hostel: Shophouse, Arab Street. It cost SGD20 a night which is reasonable. I stay in a room of 6 occupants, single bed and a locker for each. Tonight, there are only 4 people in room, including me.
What I like about this place is that it surrounded by quite numbers of tempat makan (restaurants). Convenient store like seven eleven is like 5 minutes walk, and less than 10 minutes walk to the one of the most-famous masjid (mosque) in Singapore : Masjid Sultan.
0 notes
Text
CURL Installer for Windows
Wednesday - October 14, 2015 at 12:38 AM.
I tried to install curl for windows, but it keeps telling me some ssl, cafile, capath and whatever error. I ended up using curl installer from http://www.confusedbycode.com/curl/ (I downloaded curl v7.45.0). Luckily it works right after the installation is finished. Now, the curl command is accessible via cmd ;)
0 notes
Text
New Notebook, Acer Aspire One D270
Yesterday, I bought second hand netbook, Acer Aspire One D720. It was equipped with 1 GB ram and 250 GB of storage (WD, 5400 RPM) and cost me MYR 470. I upgraded the ram to 4 GB and its storage to 1TB, Hitachi 7200 RPM. I'm planning to use it for browsing, some light coding and writing.
Here is the product page of my mini machine : http://www.acer.com.ph/ac/en/PH/content/model/NU.SGASP.004
0 notes
Text
`composer self-update` SSL Certificate Failed
Wednesday - October 14, 2015 at 1:41 AM.
I faced a problem, whereas doing composer update returns '..SSL Certificate Failed..'. I checked my cert file using:
php -r "print_r(openssl_get_cert_locations());"
and turns out that it points to default path of .pem file which is undefined in my machine.
Array ( [default_cert_file] => f:\repo\winlibs_openssl_vc11_x86/cert.pem [default_cert_file_env] => SSL_CERT_FILE [default_cert_dir] => f:\repo\winlibs_openssl_vc11_x86/certs [default_cert_dir_env] => SSL_CERT_DIR [default_private_dir] => f:\repo\winlibs_openssl_vc11_x86/private [default_default_cert_area] => f:\repo\winlibs_openssl_vc11_x86 [ini_cafile] => [ini_capath] => )
After some googling, turns out that xampp has stored .pem file which can be used to tackle this issue, as stated in http://www.askinas.net/php/solved-composer-ssl-certificate-failed-64.html. Since i'm using xampp in my small machine (although i only install it to get php), i added below code in my php.ini file:
openssl.cafile="C:\xampp\perl\vendor\lib\Mozilla\CA\cacert.pem"
Now, I can update my composer using composer self-update. No more SSL Certificate Failed :D
0 notes
Text
Up and Running with MySQL on Mac
I used MAMP. Installation was pretty easy for Apache/nginx with MySQL. But, I felt that it becomes quite heavy for my machine (Macbook Air 2011). Then I moved to XAMPP. Installation was pretty easy as well. But still, quite heavy for my machine. Tried Docker with Kitematic. Having no problem installing MySQL. But since Docker is using virtualization, it felts heavy on my machine. Now, I'm using native MySQL package.
Download MySQL .dmg file from http://dev.mysql.com/downloads/mysql/
Install the downloaded file. A MySQL panel will be shown in System Preference if installation succeed.
To connect with MySQL, open terminal and type :
/usr/local/mysql/bin/mysql -u root -h localhost -p
Since the password of fresh-installed MySQL is set to blank, we can hit enter when prompted for password.
0 notes
Photo
How the Geneva Drive (the mechanical step that makes the second hand on a clock work by turning constant rotation into intermittent motion) works.
575K notes
·
View notes
Text
Using HTML5 Attribute Pattern
Snippet:
<input type="text" pattern="your-pattern-here" title="message upon unmatched pattern">
Common Patterns:
Email
[a-z0-9._%+-]+@[a-z0-9.-]+.[a-z]{2,3}$
<input type="text" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$" title="Invalid email format">
Only numbers
-?[0-9]*(.[0-9]+)?
<input type="text" pattern="-?[0-9]*(\.[0-9]+)?" title="This field must only consists of numbers">
Only letters
[a-zA-Z ]*
<input type="text" pattern="-?[0-9]*(\.[0-9]+)?" title="This field must only consists of letters">
URL with http/https
https?://.+
<input type="text" pattern="-?[0-9]*(\.[0-9]+)?" title="Invalid URL format (please include http or https">
Domain (without http/https)
(a-zA-Z0-9?.)+[a-zA-Z]{2,6}
<input type="text" pattern="([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}" title="Invalid domain">
Basic Password (6 or more characters)
.{6,}
<input type="text" pattern=".{6,}" title="Password must be 6 or more characters">
Password that must contain 8 or more characters that are of at least one number, and one uppercase and lowercase letter
(?=.\d)(?=.[a-z])(?=.*[A-Z]).{8,}
<input type="text" pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" title="Password must be 8 or more characters and contains at least a number, one uppercase letter and one lowercase letter">
References:
http://www.w3schools.com/tags/att_input_pattern.asp
http://html5pattern.com
0 notes
Text
CSS Truncate Text
.truncate { width: 250px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
Sources:
https://css-tricks.com/snippets/css/truncate-string-with-ellipsis
https://css-tricks.com/snippets/css/truncate-string-with-ellipsis
0 notes
Text
CSS Text Transform
Short snippet to remind that CSS can help transforming text to uppercase, lowercase or capitalize.
p.uppercase { text-transform: uppercase; } p.lowercase { text-transform: lowercase; } p.capitalize { text-transform: capitalize; }
0 notes
Text
Shall I Shell?
Doing repetitive work is unpleasant. Why shall I execute some code to setup my workspace? I shall shell it
What I mean by shell it is to make shell script for automating my task.
As stated in wikipedia, a shell script is a computer program designed to be run by the Unix shell, a command line interpreter1. For example, to start my laravel application I need to:
Go to Desktop/laravel
Execute php artisan serve from terminal
What I want to achieve:
Execute one file to start laravel server
Since I want to start my laravel project by executing one file from my desktop, I will create a file named init.sh in my desktop. *.sh is file extension for shell script.
My desktop now contains 2 things:
init.sh
laravel
Inside init.sh, I put some codes to start laravel server:
#Get current directory of this file #and `cd` to current directory CURRENT_DIR=$(dirname $0) cd $CURRENT_DIR #Now since my current directory is at same level #as my laravel directory, to start laravel server I can do: php laravel/artisan serve
Of course, I need to make that init.sh file executable. I'll just type this code in terminal:
chmod +x /Users/Mac/Desktop/init.sh
All settled :D. Now, to start laravel server I just need to click my init.sh file and open with terminal.
Anyway, how to install laravel? -- Just check on my related posts below :)
Related posts:
OSX and Laravel in 3 Steps
https://en.wikipedia.org/wiki/Shell_script ↩︎
0 notes
Text
Cave Man and `JSON.stringify`
The JSON.stringify() method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.1
Using javascript, I used to do cave-man debug using console.log(). In some cases, I console.log() to get the data returned from ajax call (using jQuery). E.g:
$.post('/my-url',my-post-data) .done(function(data){ console.log('done'); });
Above code is useful to indicate that our script is succesfully executing done callback. But I also want to log what's inside data. Unfortunately, if I concat data directly:
console.log('done'+data);
It will return: done[object Object] which is not what I want.
Well, that makes sense since the data is an object. So, here is where JSON.stringify() come to help. Just wrap the data:
console.log('done:'+JSON.stringify(data));
And it will return:
done:{"sample1":"sample-data-1","sample2":"sample-data2"}
That is one of my experience using JSON.stringify(). See you to the next post :D
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify ↩︎
0 notes