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 //code to get a joomla user from the database | |
$query = 'SELECT * FROM #__user WHERE name == "' . $this->article->params->get('user_to_find') . '"'; | |
$db = $mainframe->getDBObject; | |
$db->setQuery($query,0,0); | |
$rows = $db->getObjectList(); |
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 | |
/** | |
* @version $Id: user.php 14401 2010-01-26 14:10:00Z louis $ | |
* @package Joomla | |
* @subpackage User | |
* @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. | |
* @license GNU/GPL, see LICENSE.php | |
* Joomla! is free software. This version may have been modified pursuant to the | |
* GNU General Public License, and as distributed it includes or is derivative | |
* of works licensed under the GNU General Public License or other free or open |
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
def foo(bar, baz) | |
blah | |
blah | |
blah | |
end | |
compare with c equivalent: |
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 AddLink(item) | |
{ | |
if(item.linkageExportForAS) | |
{ | |
fl.outputPanel.trace(item.name + "-> currently linked"); | |
return; | |
} | |
// split the string at the . to remove .png |
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 AddLink(item) | |
{ | |
if(item.linkageExportForAS) | |
{ | |
fl.outputPanel.trace(item.name + "-> currently linked"); | |
return; | |
} | |
// split the string at the . to remove .png |
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
def to_xml | |
rtn = "<task>" | |
instance_variables.each do |i| | |
rtn += "<#{i[1..-1]}>#{instance_variable_get(i)}</#{i[1..-1]}>" | |
end | |
rtn += "</task>" | |
rtn | |
#"<task><id>#{@id}</id><name>#{@name}</name><desc>#{@desc}</desc><priority>#{@priority}</priority></task>" | |
end |
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
@in_item = false #are we in channel or item? | |
@link = [] #current link. becuase links and texts go together | |
line = gets | |
while(line) | |
if line =~ /<item>/ | |
puts "<h2><a href=#{@link[0]}>#{escape(@link[1])}<\/a><\/h2>" | |
@in_item = true | |
elsif line =~ /<\/item>/ |
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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'yaml' | |
require 'chronic' | |
require 'date' | |
require 'time' | |
FILENAME = File.expand_path "~/.growls" |
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
require 'securerandom' | |
require 'thread' | |
mutex = Mutex.new | |
pause = false | |
pauser = Thread.new do | |
while (true) do | |
s = gets | |
mutex.synchronize do |
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
require 'securerandom' | |
require 'thread' | |
mutex = Mutex.new | |
pause = false | |
pauser = Thread.new do | |
while (true) do | |
s = gets | |
mutex.synchronize do |