Just a quick post on how to setup a refresh hotkey in Sublime on Windows. All you have to do is the following:
1) Open sublime 2) Select Preferences from the top menu and then click “Key Bindings – Default” 3) Go to the end of the file and add a comma to the last entry:
Now all you have to do is save the file and F5 will now refresh your project! If you want to change the hotkey, simply switch [“f5”] for another value.
Leave a comment below if you have any issues or tips!
I’ve been mucking around with FullCalendar recently and decided to share one of the prototypes I’ve ended up with. It basically lets the user change the events without having to do a postback. A user simply has to click the event, type in the changes and hit update.
I’ve posted the code below, however there’s also a zip which is a little easier to manage. Note that you’ll probably want to clean it up a little if you plan to use it in production. The following libraries and plugins are also used:
– jQuery
– jQuery UI
– jQuery FullCalendar
– jQuery miniColors
What it Looks Like:
Full Calendar Example with Client Side Edits
How to Use It:
It’s all pretty straight forward, but just in case any one runs into issues there are two parts to this example. First, you generate an event template. You can then drag and drop this template onto the calendar as many times as you want.
The second part allows you to edit existing events without posting back to the server. To do this, simply click an event and then make the necessary adjustments using the top panel on the right. Once you’re done, just press update event.
The example uses the standard title property, but also includes a few others: descriptions, price, available. You can change/remove these to suit your needs, just remember to pull them out of the JavaScript as well.
I ran into a bit of trouble today trying to get datetimepicker to work within bootstrap tabs. The dialog appeared however none of the buttons seemed to work. The fields also remained unpopulated.
It turned out the the issue was caused by the fact that I’d used jquery’s clone function to duplicate the tabs without reassigning field ids. This meant that there were multiple fields with the same id, confusing datetimepicker.
The solution I used was to dynamically assign all of the ids as each tab was displayed:
/* Bind tab change events: this has been done so that there is less js overhead */
function bind_tab_change_events(){
//Bind change event
$('.nav-tabs').bind('show', function(e){
//Create vars
var selected_file_id = $(e.target).data('file_id');
//Initialisations
initialise_time_pickers('#file_' + selected_file_id + ' .timepicker', selected_file_id);
})
}
/* Initalise timepickers */
function initialise_time_pickers(selector, unique_id){
//Loop through each bound element
$.each($(selector), function(index, value){
//Set id - datepicker won't work without unique ids
$(value).attr('id', $(value).attr('id') + '_' + unique_id);
//Initialise datepicker
$(value).datetimepicker();
});
}
UPDATE:
It looks like quite a few people hitting this post are looking for a bootstrap specific alternative, Sebastien has provided a link to one in the comments below: Bootstrap DatetimePicker.
Just a quick post on how to block duplicate payments with PayPal. All you have to do is pass an invoice parameter and then select the ‘block multiple payments per invoice ID’ option in PayPal. I’ve attached an extract from PayPal’s documentation below:
1. Login at https://www.paypal.com
2. Click the ‘Profile’ subtab
3. Under ‘Selling Preferences’ click ‘Payment Receiving Preferences’
4. Choose ‘Yes, block multiple payments per invoice ID’ if you wish to utilize this feature while passing the “invoice” variable
5. Scroll to the bottom and click the ‘Save’ button
To pass the invoice number for Website Payments Standard, you will need to add a line of code to your existing button code. You cannot add this code to a button originally created as encrypted. Example below:
Just a quick post showing the config I needed to use in order to get KDiff3 working with git. It took a while to get this working so hopefully it’ll be able to help someone else out.
#Config file
[user]
email = test@test.com.au
name = test
[core]
editor = "C:\Program Files\Sublime Text 2\sublime_text.exe"
[apply]
whitespace = fix
[color]
branch = auto
diff = auto
interactive = auto
status = auto
[core]
pager = less -FRSX
whitespace = cr-at-eol
autocrlf = input
excludesfile = /Users/test/.gitignore_global
editor = mate -w
[alias]
co = checkout
lg = log --graph --pretty=oneline --abbrev-commit
[gui]
recentrepo = Y:/Projects/Junk
recentrepo = C:/xampp/htdocs/onlinemedia
[merge]
tool = kdiff3
Screenshot of git config from GUI: Git Config KDiff
Due to an issue with a few migrations in a dev environment I needed to recreate the database. A quick Google search revealed that it is possible to do this in a single line:
Next time I do an install I’ll try to document the whole thing, but for now that link is probably one of the better/simpler guides I’ve come across. If you have any problems please leave a comment below and I’ll try to get back to you.