Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Pedro Costa plcosta

🎯
Focusing
View GitHub Profile
View static_server.js
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
View gruntfile.js
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
options: {
livereload: true
},
View gist:dab7802a461a1cc05c12
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# hospub - debian 7
config.vm.define "hospub" do |hospub|
@plcosta
plcosta / backup openbase hospub
Last active Aug 29, 2015
Backup OpenBase HOSPUB
View backup openbase hospub
#!/bin/bash
#
# Nao esquecer de colocar na cron do root as linhas abaixo:
# #!/bin/bash
# TERM=linux
##### Area das variaveis ################################################
# Declaro a varialvel EXEC com o nome dos executaveis
EXEC="SIADM SIADT SIALM SICEC SIFAR SIFIN SIGAE SIGHO SIGUE SIINF SIMAT SINAT SINUT SISRH SSAME HOSPUB ATIVA"
@plcosta
plcosta / gist:f496c4b12b242a6cee04
Created Dec 20, 2014
Linux Derrubar conexões ociosas
View gist:f496c4b12b242a6cee04
#!/bin/bash
###################################################
# #
# Script para matar conexoes ociosas #
# #
# Nome: LIMPANDO_CONEXAO Versao 0.2 #
# by Guilherme Moura de Souza #
# Colaboradores: Tulio.Hoffimann #
# stack_of #
View PG::Error: ERROR: new encoding (UTF8) is incompatible
======= Prolbem =================================================================================================================
I have installed : ruby-2.0.0,postgres-9.2 , now in rails app when I execute:
rake db:create , command I get:
PG::InvalidParameterValue: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
HINT: Use the same encoding as in the template database, or use template0 as template.
: CREATE DATABASE "my_db_name" ENCODING = 'unicode'.......
bin/rake:16:in `load'
View OpensqlConnection.php
<?php
namespace LaravelDoctrine\ORM\Configuration\Connections;
use Illuminate\Support\Str;
class OpensqlConnection extends Connection
{
/**
* @param array $settings
View BedsController.php
public function index()
{
DB::connection('openbase')->enableQueryLog();
$internados = Bed::where('c02codclin', '002')->get();
dd( $internados );
}
View SublimeText2Packages
Additional PHP Snippets
DocBlockr
jQuery
Package Control
PHP Namespace Command
PHP-Twig
PhpBeutifier
Phpcs
PhpDoc
Pretty JSON
View gist:5384132
var count = 0;
var __actionMessage = false;
function atualizaLoad() {
var elem = $( "loadCenterContent" );
if (count == 0) {
$( "loadCenter" ).removeClassName( "loadCenterMaior" );
$( "loadCenter" ).addClassName( "loadCenter" );
elem.innerHTML = "Carregando";
}
You can’t perform that action at this time.