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 ApplicationController < ActionController::Base | |
session :off | |
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
<?php | |
session_start(); | |
require_once("response.php");//response.php is the kookoo xml preparation class file | |
$r = new Response(); | |
$r->setFiller("yes"); | |
$recore_wav="update"; | |
if(isset ($_REQUEST['event']) && $_REQUEST['event']== "NewCall" ) | |
{ | |
$_SESSION['caller_number']=$_REQUEST['cid']; | |
$_SESSION['kookoo_number']=$_REQUEST['called_number']; |
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
import httplib | |
c=httplib.HTTPConnection('localhost:9002') | |
headers = {"Content-type": "text/xml;charset=UTF-8", "Accept": "text/xml"} | |
params = """<ENVELOPE> | |
<HEADER> | |
<TALLYREQUEST>Export Data</TALLYREQUEST> | |
</HEADER> | |
<BODY> | |
<EXPORTDATA> | |
<REQUESTDESC> |
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
before_filter :check_and_redirect | |
protected | |
def check_and_redirect | |
if current_user.user_level = "Admin" | |
redirect_to controller: 'admin', action: 'index' | |
else | |
redirect_to controller: 'user', action: '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
before_filter :check_and_redirect | |
protected | |
def check_and_redirect | |
if current_user.user_level = "Admin" | |
user = 'admin' | |
landing_page = 'index' | |
else | |
user = 'user' |
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
sudo apt-get install graphicsmagick-libmagick-dev-compat libmagickwand-dev | |
sudo gem install rmagick | |
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 'csv' | |
CSV.open("file_name.csv",'w") do |csv| | |
csv << "what,ever,you,want,to,give,as,input" | |
csv << "its,easy" | |
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
def isLeapYear(yearVar) | |
if (yearVar % 4 == 0) | |
if (yearVar % 100 == 0) | |
if(yearVar % 400 == 0) | |
return true | |
end | |
return false | |
end | |
return true | |
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
a = [1,2,3,4] | |
b = Array.new | |
a.each do | |
b << a * 2 | |
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
doubled_array = [1,2,3,4].map{ |i| i*2 } |
OlderNewer