Skip to content

Instantly share code, notes, and snippets.

View m4nu56's full-sized avatar
🏠
Working from home

Emmanuel Balpe m4nu56

🏠
Working from home
View GitHub Profile
@kmatt
kmatt / delay_pg_restore_matviews
Last active January 4, 2024 18:17
Delay materialized view refresh during pg_restore
pg_dump database -Fc backup.dump
pg_restore -l backup.dump | sed '/MATERIALIZED VIEW DATA/d' > restore.lst
pg_restore -L restore.lst -d database backup.dump
pg_restore -l backup.dump | grep 'MATERIALIZED VIEW DATA' > refresh.lst
pg_restore -L refresh.lst -d database backup.dump
@dawsontoth
dawsontoth / app.js
Created December 8, 2011 21:06
StoreKit/Example/app.js
/*
Learn the basics of Storekit with this example.
Before we can do anything in our app, we need to set up iTunesConnect! This process can be a little painful, but I will
guide you through it so you don't have to figure it out on your own.
Follow these steps:
1) Log in to your Apple Developer account at https://itunesconnect.apple.com/
2) Click "Manage Your Applications".
@dawsontoth
dawsontoth / app.js
Created October 10, 2011 10:11
iOS Text Field Suggestions in Appcelerator Titanium
/**
* This demonstrates how to show suggestions on a text field using just JavaScript with Appcelerator Titanium.
*
* You will need to download four images to get this to work:
*
* 1) http://dl.dropbox.com/u/16441391/Suggest/bg.png
* 2) http://dl.dropbox.com/u/16441391/Suggest/bg@2x.png
* 3) http://dl.dropbox.com/u/16441391/Suggest/separator.png
* 4) http://dl.dropbox.com/u/16441391/Suggest/separator@2x.png
*
@dawsontoth
dawsontoth / app.js
Created June 6, 2011 20:40
Rate my app in Appcelerator Titanium Mobile
/**
* The following snippet will ask the user to rate your app the second time they launch it.
* It lets the user rate it now, "Remind Me Later" or never rate the app.
*/
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
win.addEventListener('open', checkReminderToRate);
win.add(Ti.UI.createLabel({ text: 'This is a simple app that will remind you to rate it.' }));
win.open();
function checkReminderToRate() {
@MorningZ
MorningZ / Appcelerator Titanium "PickerView"
Created April 12, 2011 14:04
Create slide up picker views to give your user a nice way to make choices (for iOS)
/**
* @description: This is the iPhone version to create picker views on the fly :-)
* @author: Stephen G
* @date: 04/11/2011
* @screenshot: http://yfrog.com/h4vr6ep
*
* @thanks to: http://cssgallery.info/making-a-combo-box-in-titanium-appcelerator-code-and-video/
*
* Example of use (two different pickers using same function to create):
*
@dawsontoth
dawsontoth / notificationsInAndroid.js
Created March 4, 2011 22:33
Notifications in Android using Titanium Appcelerator Mobile
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
win.add(Ti.UI.createLabel({ text: 'Look for the notification! It should be there now.' }));
win.open();
Titanium.Android.NotificationManager.notify(
0, // <-- this is an ID that we can use to clear the notification later
Ti.Android.createNotification({
contentTitle: 'Cheese, Gromit!',
contentText: 'Swiss',
tickerText: 'Our app made a notification!',
(function ( jQuery ) {
$( 'body' ).delegate( ".ui-page", "pagebeforeshow", function( event, opts ) {
var $page = $(event.target),
reloadPage = false,
cacheStrategy = $page.data('cache'),
pageInstance = $page.data('page'),
invalidateCache = pageInstance.dirtyCache;
// Check if page never gets cached
if ( cacheStrategy == 'never' ) {
// RATER MODULE for Appcelerator Titanium
/*
WHAT IS IT:
Create a cycling reminder to go rate your app at the App Store. Tracks
the app launch count, and reminds the user every 20 launches (configurable) to
rate the app, with a click to launch the app page in the App Store.
Reminders stop if the user clicks the "Rate Now" or "Don't Remind Me" options.
USAGE: