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
$(function() { | |
$('#trigger').on('click', function(e) { | |
e.preventDefault(); | |
$.ajax({ | |
url: '/books/1/simpleDom', | |
success: function (data) { | |
$('#target').html(data); | |
}, | |
fail: function (data) { |
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
#! /bin/bash | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $0 infoq_presentation_url" | |
exit 1 | |
fi | |
url_with_spaces=`curl -A "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10" $1 | grep "<source src=" | tr -dc "[:print:]"` | |
url=${url_with_spaces//<source src=/} | |
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
#! /bin/bash | |
# Author: Shirish Padalkar (https://twitter.com/_Garbage_) | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $0 infoq_presentation_url" | |
exit 1 | |
fi | |
url_with_spaces=`curl -A "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10" $1 | grep "<source src=" | tr -dc "[:print:]"` |
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
alias server='open http://localhost:8000 && python -m SimpleHTTPServer' |
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.riteshsangwan.ossoc.core.actions; | |
import com.opensymphony.xwork2.ActionContext; | |
import com.opensymphony.xwork2.ActionSupport; | |
import com.riteshsangwan.ossoc.core.dao.FilesBo; | |
import com.riteshsangwan.ossoc.core.entities.Files; | |
import com.riteshsangwan.ossoc.core.entities.Users; | |
import com.riteshsangwan.ossoc.core.util.MyFile; | |
import com.riteshsangwan.ossoc.core.util.Operations; | |
import java.io.ByteArrayInputStream; |
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
Show hidden characters
# Get Sublime to use your rvm ruby... Change your ~/Library/Application Support/Sublime Text 2/Packages/Ruby/Ruby.sublime-build | |
# (for ST3: ~/Library/Application Support/Sublime Text 3/Packages/User/Ruby.sublime-build) to this, replacing YOURUSERNAME. | |
# I am still looking to optimize this further... For example, avoiding hardcoding by using something like $HOME, although | |
# I have yet to get any form of that to work. | |
{ | |
"working_dir": "${project_path}", | |
"cmd": [ | |
"/Users/YOURUSERNAME/.rvm/bin/rvm-auto-ruby", "-Ilib:test", "$file" | |
], |
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
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
int a11 = scanner.nextInt(); | |
int a12 = scanner.nextInt(); | |
int a13 = scanner.nextInt(); | |
int a14 = scanner.nextInt(); | |
int a15 = scanner.nextInt(); | |
int a16 = scanner.nextInt(); | |
int a17 = scanner.nextInt(); | |
int a18 = scanner.nextInt(); |
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
class UsersController < ApplicationController | |
def create | |
@user = User.new params[:user] | |
return render 'new' unless @user.save | |
flash[:notice] = "The user was created succesfully" | |
redirect_to :index | |
end |
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
function orderAction(orderInd, action, confirmationMessage) { | |
if (confirm(confirmationMessage)) { | |
$.get('server.php', { 'action': action, 'ind': orderInd }, responseHandler); | |
} | |
function responseHandler(data) { | |
if (data != 'ok') { | |
alert(data); | |
} | |
loadOrders(); |
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
public class BrandAction extends AbstractProductListAction { | |
private static final long serialVersionUID = 3647582541701870610L; | |
protected CatalogBrowsingFacade catalogBrowsingFacade; | |
protected RedirectHandler redirectHandler; | |
private static final String BRAND_CONSTANT="BRAND"; | |
private FormatStrategy formatStrategy; | |
@Override | |
public String execute() { | |
if (searchModel.getFreeTextCount() == 2) { |