A Pen by Anonasaurus Rex on CodePen.
This file contains hidden or 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
<html> | |
<head> | |
<style type="text/css"> | |
body { | |
font-family: Arial, Helvetica; | |
} | |
#body { | |
width: 100%; | |
height: 100%; |
This file contains hidden or 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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
# !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading | |
# slashes. | |
# If your page resides at | |
# http://www.example.com/mypage/test1 | |
# then use | |
# RewriteBase /mypage/test1/ | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f |
DISCLAIMER: I do not own any of the source codes provided below. This is only a tutorial on how to install CodeIgniter-Phpass-Library in your CodeIgniter applications. If you want to see the original tutorial, please go to this link: https://github.com/jenssegers/CodeIgniter-Phpass-Library
phpass is a portable password hashing framework for use in PHP applications. The preferred (most secure) hashing method supported by phpass is the OpenBSD-style bcrypt (known in PHP as CRYPT_BLOWFISH), with a fallback to BSDI-style extended DES-based hashes (known in PHP as CRYPT_EXT_DES), and a last resort fallback to an MD5-based variable iteration count password hashing method implemented in phpass itself.
- Download this .zip file: https://github.com/jenssegers/CodeIgniter-Phpass-Library/archive/master.zip
- From the downloaded files, copy the libraries and vendor folder into your CodeIgniter application folder.
This file contains hidden or 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
def create | |
@product = Product.new(params[:product]) | |
if @product.save | |
redirect_to user_url # user_url requires an ID | |
# redirect_to users_url -- use this to go to the users/index | |
else | |
render action: "new" | |
end | |
end |
This file contains hidden or 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
$(document).ready(function() | |
{ | |
$("#append_form").submit(function() { | |
// The \n below is for new line in JavaScript | |
var append_texts = "<div>\n"+ | |
$("#append_text_1").val() +" "+ $("#append_text_1").val() +"\n"+ | |
"</div>"; | |
$("#append_area").append(append_texts); | |
}); |
This file contains hidden or 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
$(document).ready(function(){ | |
$('#images_list').sortable().on('click', 'img', function(event) { | |
var target = $(this), src = target.attr('src'); | |
target.attr('src', /cat/.test(src) ? src.replace('cat', 'ninja') : src.replace('ninja', 'cat')); | |
}); | |
/* line 1: sortable() is for the pictures to be dragged from one position to the other; and a trigger when the image is clicked | |
line 2: assigning values to variables target and src to make line 3 less confusing and short | |
line 3: short cut form of if/else statement | |
considering that the image file names used is cat1.jpg,cat2.jpg.. and respective partner picture file names are ninja1.jpg, ninja2.jpg.. | |
when the image is clicked... |