This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .bashrc / .bash_profile | |
# copy pwd to the clipboard | |
alias cpdir="pwd | tr -d '\n' | pbcopy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Andrey Butov ( andreybutov.com ) | |
// | |
import net.rim.device.api.ui.component.EditField; | |
import net.rim.device.api.ui.Graphics; | |
class BorderedEditField extends EditField { | |
BorderedEditField() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Validating a BlackBerry PIN in Perl. | |
# | |
# Andrey Butov ( andreybutov.com ) | |
# | |
my $pin = <get PIN from submitted web page data> | |
return “Error” if !defined($pin); | |
$pin = &trimAndUpper($pin); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Debugging a BlackBerry application can be done on a simulator, | |
when the bug permits that sort of thing, or on the device itself. | |
If you’re in a situation where you must debug your code while it | |
runs on a real device, your can sometimes take advantage of the | |
tethering debugger provided by the JDE; connecting the device to | |
the PC via a USB cable, and then hoping everything is stable | |
enough for you to catch a breakpoint and find your bug. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Your BlackBerry application needs to know when the user adds, | |
// removes, or changes something in the BlackBerry address book. | |
// So, how would you go about implementing this? | |
// | |
// Here is a simple class that will listen to changes in the BlackBerry address book: | |
// | |
// - Andrey Butov (andreybutov.com) | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// How do I make my Qt app start automatically at login? | |
// This solution is for Windows and Mac. It was tested with Qt 5.5. | |
// | |
// - Andrey Butov ( andreybutov.com ) | |
// | |
void setAppToStartAutomatically ( bool startAutomatically ) | |
{ | |
#if defined ( Q_OS_MAC ) | |