Skip to content

Instantly share code, notes, and snippets.

class AddBruteForceSecurityToUsers < ActiveRecord::Migration
def change
add_column :users, :failed_login_count, :integer, :default => 0
end
end
- (void)tableViewEnabled:(BOOL)enabled withBlock:(void (^)(void))block
{
if (enabled) {
[self transitionView:^{
self.tableView.alpha = 1;
_minMaxNightsHeightConstraint.constant = 0;
[_minMaxStayLabel resetStyle];
_minMaxStayLabel.text = @"";
@raulriera
raulriera / gist:bca6201e25e1d78fd17f
Created November 28, 2014 14:15
Derived data dance
echo "(•_•)"
echo "<) )╯ $USER starts"
echo " / \ "
echo ""
echo "\(•_•) "
echo " ( (> the derived data"
echo " / \ "
echo ""
echo " (•_•) "
echo "<) )> dance"
<!--- Verify that the treatmentplan creates successfully --->
<cfif treatmentplan.save()>
<!--- Loop through all the patient's teeth --->
<cfloop collection="#params.as_values_treatmentplandetail.treatment#" item="tooth">
<!--- Loop through all the treatment plans selected --->
<cfloop list="#params.as_values_treatmentplandetail.treatment[tooth]#" index="treatmentId">
<!--- Find the selected treatment (HUGE DB IMPACT) --->
<cfset treatment = model("Treatment").findByKey(treatmentId)>
<!--- Insert a new treatment detail in the plan --->
<cfset treatmentplan.createTreatmentPlanDetail(toothId=tooth, treatment=treatment.name, price=treatment.price)>
Component [controllers.Pages] has no acessible Member with name [WHEELS]
Stacktrace The Error Occurred in
/Users/raulriera/Desktop/FuseGrid SDK/workspace/default/plugins/provides/Provides.cfc: line 228
226:
227: <cffunction name="$checkSetApplicationScope" access="public" output="false" returntype="void">
228: <cfargument name="controller" required="false" type="string" default="#variables.wheels.name#" />
229: <cfargument name="action" required="false" type="string" default="" />
230: <cfscript>
<cfcomponent output="false">
<cffunction name="init" access="public" output="false" returntype="any">
<cfset this.version = "0.9.3,1.0,1.1">
<cfreturn this />
</cffunction>
<cffunction name="l" returntype="any" output="false" access="public" hint="Shortcut method to 'localize'">
<cfargument name="text" type="string" required="true" hint="Text to localize" />
// 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:
@raulriera
raulriera / Local Notification
Created July 24, 2011 20:43
How is this done?
var notification = Ti.App.iOS.scheduleLocalNotification({
alertBody: "Body message",
alertAction: "Ok",
repeat: "daily",
date: new Date().getTime()
});
@raulriera
raulriera / gist:1239923
Created September 24, 2011 22:01
Local Notification
// This piece of code makes the notification run "once" after 3 seconds of calling the
// function, but it SHOULD re appear the next day and so on right? it doesn't
(function() {
app.model.scheduleLocalNotification = function() {
// Set the target date
var d = new Date();
@raulriera
raulriera / gist:1249818
Created September 29, 2011 02:10
Why is this test failing? the same test with users is passing
test "should create patient" do
assert_difference('Patient.count') do
post :create, patient: @new_patient
end
assert_redirected_to patient_path(assigns(:patient))
end