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
sqlite3 "/Users/{#os_user}/Library/Application Support/Skype/{#skype_user}/main.db" |
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 EmailValidator < ActiveModel::EachValidator | |
EmailAddress = /\A[\w!\#$%&'*+\/=?^_\`{|}~-]+(?:\.[\w!\#$%&'*+\/=?^_\`{|}~-]+)*@(?:\w(?:[\w-]*\w)?\.)+\w(?:[\w-]*[\w])?\z/ | |
def validate_each(record, attribute, value) | |
unless value =~ EmailAddress | |
record.errors[attribute] << (options[:message] || "is not valid") | |
end | |
end | |
end |
This file has been truncated, but you can view the full 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
# encoding: utf-8 | |
City.transaction do | |
City.create! [ | |
{id: 10, country_id: 254, state_id: 122, name: "Mobile"}, | |
{id: 277, country_id: 254, state_id: 127, name: "Eagle"}, | |
{id: 429, country_id: 254, state_id: 135, name: "Macomb"}, | |
{id: 616, country_id: 254, state_id: 145, name: "Redwood Falls"}, | |
{id: 687, country_id: 254, state_id: 149, name: "Burwell"}, | |
{id: 1153, country_id: 254, state_id: 172, name: "Burlington"}, | |
{id: 1154, country_id: 254, state_id: 172, name: "Montpelier"}, |
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 | |
/** | |
* SplClassLoader implementation that implements the technical interoperability | |
* standards for PHP 5.3 namespaces and class names. | |
* | |
* http://groups.google.com/group/php-standards/web/final-proposal | |
* | |
* // Example which loads classes for the Doctrine Common package in the | |
* // Doctrine\Common namespace. |
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 | |
spl_autoload_register(function($className) | |
{ | |
$fileName = str_replace('\\', '/', ltrim($className, '\\')) . '.php'; | |
if (file_exists($fileName)){ | |
require $fileName; | |
return class_exists($className, false); | |
} | |
return false; |
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 | |
/** | |
* This sample app is provided to kickstart your experience using Facebook's | |
* resources for developers. This sample app provides examples of several | |
* key concepts, including authentication, the Graph API, and FQL (Facebook | |
* Query Language). Please visit the docs at 'developers.facebook.com/docs' | |
* to learn more about the resources available to you | |
*/ |
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
require 'rubygems' | |
require 'hornetseye_ffmpeg' | |
require 'hornetseye_xorg' | |
require 'hornetseye_alsa' | |
include Hornetseye | |
input = AVInput.new 'sintel.mp4' | |
alsa = AlsaOutput.new 'default:0', input.sample_rate, input.channels | |
audio_frame = input.read_audio | |
X11Display.show 600, :output => XVideoOutput do |display| | |
img = input.read |
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 do |f| | |
f.form_buffers.last << f.autocompleted_input(:product_name, url: autocomplete_product_name_orders_path, label: 'Product') | |
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
require 'gson-1.6.jar' | |
class GsonBuilder | |
include_package "com.google.gson" | |
def initialize | |
@gson = GsonBuilder.new.setFieldNamingPolicy(FieldNamingPolicy::LOWER_CASE_WITH_UNDERSCORES).serializeNulls().create() | |
end | |
def to_json(obj) |
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
require 'rubygems' | |
require 'stomp' | |
client_id = "client-id" | |
subscription_name = "subName" | |
topic_name = "topicName" | |
OlderNewer