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
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
uglify: { | |
build: { | |
files: { | |
'jquery.timeAutocomplete.min.js': ['src/*.js'] | |
} | |
} |
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
# You have your csv data and it looks like so... It's in a file named "my_data.csv" and we want to import it into a table named "my_things". | |
"1", "Something", "0.50", "2013-05-05 10:00:00" | |
"2", "Another thing", "1.50", "2013-06-05 10:30:00" | |
# Now you want to import it, go to the command line and type: | |
$ PGPASSWORD=PWHERE psql -h HOSTHERE -U USERHERE DBNAMEHERE -c "\copy my_things FROM 'my_data.csv' WITH CSV;" | |
# Voila! It's impoted. Now if you want to wipe it out and import a fresh one, you would do this: |
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
# You need to first download em-websocket at https://github.com/igrigorik/em-websocket | |
# Then install the gem then name this file to "server.rb" and run it: "ruby server.rb" | |
# This is a combination of code from the example at http://www.igvita.com/2009/12/22/ruby-websockets-tcp-for-the-browser/ | |
# and at http://jessedearing.com/nodes/4-pubsubbin-with-redis-eventmachine-and-websockets to publish to all connected sockets. | |
require 'em-websocket' | |
SOCKETS = [] | |
EventMachine::WebSocket.start(:host => "127.0.0.1", :port => 8080) do |ws| |
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
/** | |
* Are we running a sencha touch supported phone? Needed | |
* primarily for login page | |
* Sencha supports: iPhone, iPod touch, Android, Blackberry 6+ | |
*/ | |
var isSenchaTouchSupportedPhone = function() | |
{ | |
var ua = navigator.userAgent; | |
var supported = ( |
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
// 1. Goto 8tracks.com and login. | |
// 2. Under your profile click "Favorited tracks". | |
// 3. Open up the console (CMD+OPTION+I) in Chrome or Safari and input this: | |
var music=[];$('.track_info').each(function(){ music.push($.trim($(this).find('.a').text()) + ' - ' + $.trim($(this).find('.t').text())) });music.join("\n"); | |
// 4. Then hit enter. | |
// You will get a list of your music that you can copy/paste somewhere else. |
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
#!/bin/bash | |
# This will run compass watchers as background tasks. When you hit CTRL+C, you don't actually | |
# exit out of them, they're still running. To kill all the watchers, type ./compass kill | |
# See usage below. | |
# Usage: | |
# Put this shell file (compass) in your compass project directory (same directory as config.rb), then navigate to it | |
# on the command line and type either of the commands below. | |
# To run, just type ./compass |
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
<?php | |
set_time_limit(120); | |
$domains = ClassRegistry::init('Domain')->find('all', array( | |
'conditions' => array( | |
'url' => $_GET['domain'] | |
//'paid_recurring' => 1 | |
), | |
'recursive' => -1 | |
)); |
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
<? | |
// routes.php | |
Router::connect('/animals/:action/*', array( | |
'plugin' => 'big', | |
'controller' => 'BigAnimalsController' | |
)); | |
/* | |
* Now I navigate to /animals and I look at my action attribute on my <form> tag | |
* How come my $form->create(array('controller' => 'animals')); call still outputs: |
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
/**************************************************************** | |
* AppController.php | |
*****************************************************************/ | |
<? | |
/** | |
* Most application-wide logic should be handled here | |
* | |
*/ | |
class AppController extends Controller | |
{ |
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
<? | |
// i login successfully with if($this->Auth->login()) but as soon as I call $this->redirect($this->Auth->redirect()); | |
// it boots me back to the login screen. | |
public function beforeFilter() | |
{ | |
//Deny access to everything by default, let isAuthorized decide to let them in | |
$this->Auth->deny("*"); | |
// Set up auth error messages here, where they can actually be translated |
NewerOlder