A Pen by Captain Anonymous 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
{ | |
"vars": { | |
"@gray-base": "#000", | |
"@gray-darker": "lighten(@gray-base, 13.5%)", | |
"@gray-dark": "lighten(@gray-base, 20%)", | |
"@gray": "lighten(@gray-base, 33.5%)", | |
"@gray-light": "lighten(@gray-base, 46.7%)", | |
"@gray-lighter": "lighten(@gray-base, 93.5%)", | |
"@brand-primary": "darken(#41cac0, 6.5%)", | |
"@brand-success": "rgb(28, 184, 65)", |
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
// Add this to the onRender() of the view you want to add your file upload to | |
// The options passed in will override the default Plupload options | |
// (http://www.plupload.com/documentation.php) | |
this.fileUploadView = new FileUploadView({ | |
el: '#upload-container', | |
url: 'upload.php', | |
successMessage: 'Your file uploaded successfully.' | |
}); | |
this.fileUploadView.render(); |
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
define(function(require) { | |
'use strict'; | |
var _ = require('underscore') | |
return { | |
handleAjaxSuccess: function() { | |
if (_.isFunction(this.closeForm)) { | |
this.closeForm() | |
} |
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
<?php | |
/** | |
* On-the-fly CSS Compression | |
* Copyright (c) 2009 and onwards, Manas Tungare. | |
* Creative Commons Attribution, Share-Alike. | |
* | |
* In order to minimize the number and size of HTTP requests for CSS content, | |
* this script combines multiple CSS files into a single file and compresses | |
* it on-the-fly. | |
* |
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
render: function() { | |
this.$el.empty(); | |
var container = document.createDocumentFragment(); | |
// render each subview, appending to our root element | |
_.each(this._views, function(subview) { | |
container.appendChild(subview.render().el) | |
}); | |
this.$el.append(container); | |
} |
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
login: function (event) { | |
event.preventDefault(); // Don't let this button submit the form | |
$('.alert').remove(); // Hide any errors on a new submit | |
var url = './service/login'; | |
$('.btn-login').button('loading'); | |
var formValues = { | |
email: $('#tEmail').val(), | |
pwd: $('#tPwd').val() | |
}; |
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
/** | |
* Quick and dirty login function with hard coded credentials (admin/admin) | |
* This is just an example. Do not use this in a production environment | |
*/ | |
function login() { | |
if(!empty($_POST['email']) && !empty($_POST['password'])) { | |
// normally you would load credentials from a database. | |
// This is just an example and is certainly not secure | |
if($_POST['email'] == 'admin' && $_POST['password'] == 'admin') { | |
$user = array("email"=>"admin", "firstName"=>"Web", "lastName"=>"Scents", "token"=>base64_encode(openssl_random_pseudo_bytes(16))); |
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
<?php | |
require dirname(__FILE__) . '/functions.php'; | |
$module = md5('MODULE_NAME'); | |
$page_url = sanitize($_SERVER['PHP_SELF']); | |
if (isset($_POST['firstname'])) | |
require dirname(__FILE__) . '/save.php'; |
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
!function ($) { | |
$(function() { | |
var mSurat = function(hlmSemasa, perLaman, JumlahRekod, skopDom, callback) { | |
var RkdSudahTersiar = hlmSemasa * perLaman, | |
lamanTerakhir = Math.ceil(JumlahRekod / perLaman), | |
JumRkdSudahTersiar; | |
if(RkdSudahTersiar > JumlahRekod) | |
JumRkdSudahTersiar = JumlahRekod; | |
else |
NewerOlder