Skip to content

Instantly share code, notes, and snippets.

View empirefx's full-sized avatar

EFEX empirefx

  • Argentina, Santa Fe
View GitHub Profile
@empirefx
empirefx / test.php
Created August 8, 2019 23:33
Mssql attempt conection
<?php
$host='tcp:172.18.0.3,1433';
$dbname='Master';
$sa='sa';
$pwd='yourStrong(!)Password';
try {
//The caveat is that disabling MARS means you can only have one active statement/result at a time. So depending on how your PHP code is structured you could encounter errors when executing a second statement or accessing a result.
$dbDB = new PDO("sqlsrv:Server=$host;Database=$database;MultipleActiveResultSets=false", $sa, $pwd);
@empirefx
empirefx / Dockerfile
Last active July 27, 2019 23:20
Docker apache php mssql
FROM php:7.0-apache
COPY src/ /var/www/html/
# Add Microsoft repo for Microsoft ODBC Driver 13 for Linux
RUN apt-get update && apt-get install -y \
apt-transport-https \
gnupg \
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list \
### Keybase proof
I hereby claim:
* I am empirefx on github.
* I am efex (https://keybase.io/efex) on keybase.
* I have a public key whose fingerprint is 8911 7745 CC5C D178 83E1 1D08 85F8 0A4C E22F 4530
To claim this, I am signing this object:
@empirefx
empirefx / grooveshark.py
Created January 19, 2015 19:22
Grooveshark as native app (req: python, PyQt4)
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from PyQt4 import QtGui, QtCore, QtWebKit
import subprocess, os
from sys import exit, argv
if __name__ == '__main__':
app = QtGui.QApplication(argv)
view = QtWebKit.QWebView()
@empirefx
empirefx / interate.js
Created December 23, 2014 19:05
Iterate through json
//JQuery
function interate (arg) {
$.each(arg, function(index, value){
isObjArr = Object.prototype.toString.call( value );
if( isObjArr === '[object Object]' ) {
notThis = (index === 'this') ? "" : index;
console.log("found: object "+notThis);
var socket = io.connect();
socket.on('info', function (data) {
console.log(data);
var state = JSON.parse(data.state);
for( i = 0; i < state.length; i++)
{
var body = document.getElementsByTagName("body")[0];
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from PyQt4.QtGui import QApplication
from PyQt4.QtCore import QUrl
from PyQt4.QtWebKit import QWebView
from sys import exit, argv
if __name__ == '__main__':
app = QApplication(argv)
@empirefx
empirefx / ci_helper.php
Created September 16, 2014 03:57
HTMLpurifier
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Codeigniter HTMLPurifier Helper
*
* Purify input using the HTMLPurifier standalone class.
* Easily use multiple purifier configurations.
*
* @author Tyler Brownell <tyler@bluefoxstudio.ca>
* @copyright Public Domain
/* */
table{background-color: green;}
/* */
.windowbg2:last-child{width: 100%;}
/* background 1 */
body {background-color:#fff;}
/* background 2 */
@empirefx
empirefx / AngularJS.html
Created April 11, 2014 01:05
AngularJS easy way..
<!doctype html>
<html data-ng-app="prueba">
<meta charset="utf-8"/>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular-route.js"></script>
<script type="text/javascript">
var probando = angular.module("prueba", ['ngRoute']);
probando.config(function($routeProvider) {