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 | |
require_once __DIR__.'/../vendor/autoload.php'; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpFoundation\Response; | |
$app = new Silex\Application(); | |
// Twig | |
$app->register(new Silex\Provider\TwigServiceProvider(), array( |
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
<% | |
' Command to set the region configurations to | |
' any country you want | |
' 1046: Brazil | |
' 1033: EUA | |
Session.LCID = 1046 | |
%> |
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
-- Convert int to datetime with this script. | |
-- If anyone has a better or a more beautiful method, please, feel free to fork and change it. :) | |
declare @i as int | |
select @i = 20121029 --aaaammdd | |
select convert(datetime, convert(char(8), @i)) |
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
<% | |
On Error Resume Next | |
downloadPath = <<path>> | |
fileName = <<name>> | |
fileExt = <<extension>> | |
varTo = Server.MapPath(downloadPath) & "\" & fileName & fileExt | |
Set objStream = Server.CreateObject("ADODB.Stream") | |
objStream.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
data MultSet = Nil | MS Int Int (MultSet) | |
deriving Show | |
ins k (Nil) = MS k 1 (Nil) | |
ins k (MS e n ms) | |
| k == e = MS e (n+1) ms | |
| otherwise = MS e n (ins k ms) | |
ltm [] = Nil | |
ltm (x:xs) = ins x (ltm xs) |
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
/* | |
* Como matar processos no SQL Server | |
* e ter exclusividade na base | |
* | |
* Fonte: http://sqldicas.com.br/dicas/matando-processos-no-sql/ | |
*/ | |
declare @spid int | |
declare @db_name varchar(100) | |
set @db_name = 'NomeDaBase' -- coloque o nome da base aqui |
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
#include<sys/types.h> | |
#include<sys/socket.h> | |
#include<arpa/inet.h> | |
#include<stdio.h> | |
#include<stdlib.h> | |
#define PORTA 8888 | |
#define MAXBUF 20 | |
#define MAXCONECT 5 |
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
#include<sys/types.h> | |
#include<sys/socket.h> | |
#include<arpa/inet.h> | |
#include<stdio.h> | |
#include<stdlib.h> | |
#define PORTA 8888 | |
main(){ | |
int e_socket, conexao; |
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
#!/bin/bash | |
gcc server.c -o server -lpthread | |
gcc client.c -o client -lpthread |
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
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <arpa/inet.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <pthread.h> | |
#define PORTA 8880 | |
#define MAXBUF 20 | |
#define MAXCONECT 5 |