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
<div id="membercounterwrapper"> <span>EDITION #</span> | |
<a href="#"><span class="odom">0</span></a> | |
</div> |
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
for(x=0; x<500; x++) { | |
var title = "Ticket #" + x; | |
var subject = "Test ticket #" + x; | |
var body = "This is test ticket #" + x; | |
$.ajax({ | |
url: '/api/v2/tickets.json', | |
contentType:'application/json', | |
type: 'POST', | |
data: JSON.stringify({"ticket": {"subject": subject , "comment": { "body": body }}}) | |
}); |
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
var objectSchema = Joi.object().keys({ | |
username: Joi.string().alphanum().min(3).max(50).required(), | |
email: Joi.string().email().required() | |
}); |
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
var stringSchema = Joi.string().min(3).max(30); | |
Joi.validate(‘valid string’, stringSchema, | |
function(error,val) { | |
//do stuff | |
}); |
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
var http = require("http"); | |
http.createServer(function (request, response) { | |
// Send the HTTP header | |
// HTTP Status: 200 : OK | |
// Content Type: text/plain | |
response.writeHead(200, {'Content-Type': 'text/plain'}); | |
// Send the response body as "Hello World" |
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
$whitelistIPs = array('127.0.0.1', 'fe80::1', '::1', 'my.organisation.ip.address'); | |
//allow app_dev.php only under these conditions (prevent for production environment) uses HTTP_X_FORWARDED_FOR because behind load balancer | |
if ( | |
isset($_SERVER['HTTP_X_FORWARDED_FOR']) && | |
( ! in_array(@$_SERVER['HTTP_X_FORWARDED_FOR'], $whitelistIPs) ) | |
){ | |
header('HTTP/1.0 403 Forbidden'); | |
exit('You are not allowed to access the development environment.'); | |
} |
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 | |
function add_to_custom_feed($qv) { | |
if (isset($qv['feed']) && !isset($qv['post_type'])) | |
$qv['post_type'] = array('post', 'books', 'events'); | |
return $qv; | |
} | |
add_filter('request', 'add_to_custom_feed'); | |
?> |
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
/* | |
*In order to remove native style is possible to set “appearance” to none, | |
*thus to enable complete custom styling of our submit buttons we can write the following CSS statement: | |
*Some notes: | |
*vendors-specific declarations (-webkit, -moz) may be removed | |
*do not reset appearance for all the HTML elements (ie: “*”) or you will have to work hard to restyling complex components like select! | |
*/ | |
input[type='submit'] | |
{ | |
-webkit-appearance: none; |
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
<form action="search.php" method="get"> | |
<input type="submit" name="search" value="Go" style="float: right" /> | |
<div style="overflow: hidden; padding-right: .5em;"> | |
<input type="text" name="term" style="width: 100%;" /> | |
</div> | |
</form> |
NewerOlder