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
# MySQL. Versions 4.1 and 5.0 are recommended. | |
# | |
# Install the MySQL driver: | |
# gem install mysql2 | |
# | |
# And be sure to use new-style password hashing: | |
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html | |
development: | |
adapter: mysql2 | |
encoding: utf8 |
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
exports.ext = function () { | |
var extTypes = { | |
"3gp" : "video/3gpp" | |
, "a" : "application/octet-stream" | |
, "ai" : "application/postscript" | |
, "aif" : "audio/x-aiff" | |
, "aiff" : "audio/x-aiff" | |
, "asc" : "application/pgp-signature" | |
, "asf" : "video/x-ms-asf" | |
, "asm" : "text/x-asm" |
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
/* | |
Copyright 2011 Martin Hawksey | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
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
package interviewstreet; | |
import java.util.Arrays; | |
import java.util.Scanner; | |
public class Solution { | |
int min=1; | |
int val=1; | |
public static void main(String[] args) { |
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
// JavaScript function for converting simple XPath to CSS selector. | |
// Ported by Dither from [cssify](https://github.com/santiycr/cssify) | |
// Example: `cssify('//div[@id="girl"][2]/span[@class="body"]//a[contains(@class, "sexy")]//img[1]')` | |
var sub_regexes = { | |
"tag": "([a-zA-Z][a-zA-Z0-9]{0,10}|\\*)", | |
"attribute": "[.a-zA-Z_:][-\\w:.]*(\\(\\))?)", | |
"value": "\\s*[\\w/:][-/\\w\\s,:;.]*" | |
}; |
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
package com.cyp.codechef.marcontest; | |
import java.io.IOException; | |
import java.util.Scanner; | |
/* | |
* Cypronmaya - Codechef March 2012 Contest - Problem Code : SPOON | |
*/ | |
class SPOON { |
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
#!/usr/bin/env coffee | |
# Call the program with: coffee phantom.coffee http://url.to/screengrab | |
phantom = require 'phantom' # npm install phantom | |
child_process = require 'child_process' | |
url = process.argv[2] | |
createScreenshot = (page, filename) -> |
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 uploadify_data = { | |
'AWSAccessKeyId': '<%= @uploadify_data[:access_key] %>', | |
'bucket': '<%= @uploadify_data[:bucket] %>', | |
'acl': 'private', | |
'key': '<%= @uploadify_data[:key] %>${filename}', | |
'signature': '<%= @uploadify_data[:signature] %>', | |
'policy': '<%= @uploadify_data[:policy] %>', | |
'success_action_status': '<%= @uploadify_data[:sas] %>', | |
'folder': '', | |
'Filename': '' |
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
// Java function for converting simple XPath to CSS Selector. | |
// Used cssify.js from [cssify.js](https://gist.github.com/Dither/1909679) | |
// Removed log statements (as window objects aren't supported in ScriptEngine) | |
import java.io.FileNotFoundException; | |
import java.io.FileReader; | |
import javax.script.Invocable; | |
import javax.script.ScriptEngine; | |
import javax.script.ScriptEngineManager; |
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
// Use Parse.Cloud.define to define as many cloud functions as you want. | |
// For example: | |
Parse.Cloud.define("hello", function(request, response) { | |
response.success("Hello world!"); | |
}); | |
Parse.Cloud.define("userWithEmailExists", function(request, response) { | |
var email = request.params.email; | |
if (email != null && email !== "") { | |
email = email.trim(); |
OlderNewer