Skip to content

Instantly share code, notes, and snippets.

View maxan's full-sized avatar
🙃

Anderson Marinho maxan

🙃
View GitHub Profile
@maxan
maxan / DateSelector.mxml
Last active January 2, 2016 06:08
Competence date selector.
<?xml version="1.0" encoding="utf-8"?>
<s:HGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" initialize="{startComponente_Initialize(event)}"
creationComplete="{createComponent_CreationComplete(event)}"
width="232">
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.events.FlexEvent;
<?php
class MY_Session extends CI_Session {
protected $cliTestingDriver = 'codeception';
public function __construct(array $params = array())
{
parent::__construct($params);
<?php
/**
* CI3 flat file session driver used for testing with Codeception
*/
/**
* Class CI_Session_codeception
*/
class CI_Session_codeception extends CI_Session_driver
@maxan
maxan / bench.php
Last active August 29, 2015 14:14 — forked from ircmaxell/bench.php
<?php
use ReckiCT\Jit;
if (function_exists('class_alias')) {
// HippyVM doesn't have a class_alias, so this will break things.
require __DIR__ . '/../vendor/autoload.php';
}
define("IM", 139968);
@maxan
maxan / bench.php
Created February 5, 2015 14:22
Zend bench.php (from php-src)
<?php
if (function_exists("date_default_timezone_set")) {
date_default_timezone_set("UTC");
}
function simple() {
$a = 0;
for ($i = 0; $i < 1000000; $i++)
$a++;
@maxan
maxan / municipios_brasileiros.js
Last active December 25, 2015 12:27
Municípios Brasileiros (da Wikipédia)
// Fonte dos municípios: https://pt.wikipedia.org/wiki/Lista_de_munic%C3%ADpios_do_Brasil
$('table tbody > tr > td > ul > li').each(function(index, element) {
pattern = /([\s\S]*)(\([A-Za-z]{2}\))/;
text = $(this).text();
result = text.match(pattern);
result.forEach(function (e, i, a) { a[i] = a[i].trim(); });
console.log('INSERT INTO Municipio (Nome, Estado) VALUES (\'' + result[1] + '\', \'' + result[2].replace(/(\()(\w+)(\))/, '$2') + '\');');
});
namespace YourNamespace
{
/// <summary>
/// Uses the Name value of the <see cref="ColumnAttribute"/> specified to determine
/// the association between the name of the column in the query results and the member to
/// which it will be extracted. If no column mapping is present all members are mapped as
/// usual.
/// </summary>
/// <typeparam name="T">The type of the object that this association between the mapper applies to.</typeparam>
public class ColumnAttributeTypeMapper<T> : FallbackTypeMapper
@maxan
maxan / launch.json
Created March 31, 2017 00:03
Example launch.json file when it exists one .net core project and angular under the same root folder...
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:4200",
"sourceMaps": true,
"webRoot": "${workspaceRoot}/my-own-app"
@maxan
maxan / web.config
Last active November 14, 2023 11:43
IIS Config to React Router App
<system.webServer>
<rewrite>
<rules>
<rule name="React Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
</conditions>
@maxan
maxan / certificates.txt
Created December 4, 2017 15:47 — forked from jnwelzel/certificates.txt
Client authentication through SSL certificate in JBoss AS 7.1.1.Final. This configuration will make sure that only clients whose certificates are trusted by the server may have access to the application (standalone.xml line 272)
PASSWORD
changethis
SERVER KEYSTORE - used by the server to establish a secure connection (HTTPS)
c:\eclipse\jdk1.7.0_05\jre\bin\keytool.exe -genkey -keyalg RSA -alias localhost -keystore localhost.jks -validity 365 -keysize 2048
CLIENT KEYSTORE - used to generate ".cer" file that wil be used in the server's trustore and in the browser to identify the client with the server
c:\eclipse\jdk1.7.0_05\jre\bin\keytool.exe -genkey -keyalg RSA -alias jonwelzel -keystore jonwelzel.jks -validity 365 -keysize 2048