Skip to content

Instantly share code, notes, and snippets.

View alexferreira's full-sized avatar

Alex Ferreira alexferreira

  • Juster
  • São Paulo, SP
View GitHub Profile
if (int.Parse(ihid.Value.ToString()) == 0)
{
SqlConnection Cn = new SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings["exportaminasConnectionString"].ConnectionString);
Cn.Open();
SqlCommand Cmd = new SqlCommand("insert into TBEXM_ServicosComerciais (pais, endereco, fone, fax, email, website, chefe) " +
"values (@pais, @endereco, @fone, @fax, @email, @website, @chefe) ", Cn);
Cmd.CommandType = CommandType.Text;
session_start();
include '../../includes/inc_conexao.php';
?>
<pre style="float:right; "><h3>Cookie</h3><? print_r($_COOKIE);?></pre>
<pre style="float:right; "><h3>Sessoes</h3><? print_r($_SESSION);?></pre>
<?
if($_POST["login"]!="" && $_POST["senha"]!="") {
$user = $_POST["login"];
def import
render :layout => false, :nothing => true
arquivo = "#{Rails.root}/Workbook1.csv"
#puts Benchmark.measure {
Tvschedule.transaction do
FasterCSV.foreach(arquivo, :encoding => 'u') do |row|
data = Time.parse(row[1]).strftime("%Y-%m-%d")
canal = Channel.where(:name => row[0]).select(:id).first
@tvschedule = Tvschedule.create
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.mongodb.mongod</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/Cellar/mongodb/1.6.4-x86_64/bin/mongod</string>
<string>run</string>
Intranet::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
filenames = Dir.glob(Rails.application.paths.app.models.collect { |path| File.join(path, "**/*.rb") })
$class_names = []
filenames.each do |filename|
$class_names += File.read(filename).scan(/class ([\w\d_\-:]+)/).flatten
end
<head>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js'></script>
<script src="/socket.io/socket.io.js" type="text/javascript" charset="utf-8"></script>
<script src="js/highstock.src.js" type="text/javascript"></script>
<script type="text/javascript" src="js/themes/gray.js"></script>
<script>
var chart;
var tweets = [];
var socket = io.connect('http://localhost:8080');
@alexferreira
alexferreira / gist:5366348
Created April 11, 2013 19:14
exemplo json do twitter
{ created_at: 'Thu Apr 11 19:13:36 +0000 2013',
id: 322427230401744900,
id_str: '322427230401744896',
text: 'empezó una @runtastic sesión de seguimiento en tiempo real. Ve mi progreso en vivo y anímame - http://t.co/IiCG7OP3RH #runtastic #iphone',
source: '<a href="http://runtastic.com" rel="nofollow">runtastic</a>',
truncated: false,
in_reply_to_status_id: null,
in_reply_to_status_id_str: null,
in_reply_to_user_id: null,
in_reply_to_user_id_str: null,
@alexferreira
alexferreira / Gruntfile.js
Created May 19, 2013 20:08
Grunt for minify javascript files
module.exports = function(grunt) {
grunt.initConfig({
uglify: {
options: {
banner: '/*! application.js <%= grunt.template.today("yyyy-mm-dd hh:MM") %> */\n',
},
build: {
src: 'public/assets/application.min.js',
dest: 'public/assets/application.min.js'
}
<span class="status aguardando box-positioning"><i class="icon-clock-o"></i></span>