Skip to content

Instantly share code, notes, and snippets.

@bazo
bazo / convert.sql
Created April 7, 2017 13:15
convert mysql db to utf8mb4
delimiter //
DROP PROCEDURE IF EXISTS convert_database_to_utf8mb4 //
CREATE PROCEDURE convert_database_to_utf8mb4()
BEGIN
DECLARE table_name VARCHAR(255);
DECLARE done INT DEFAULT FALSE;
DECLARE cur CURSOR FOR
@bazo
bazo / server.py
Created February 27, 2017 20:09 — forked from lalinsky/server.py
Example audio fingerprint server using Chromaprint
import chromaprint
from flask import Flask, request, jsonify
SQL_TABLES = """
CREATE TABLE IF NOT EXISTS fingerprint
(
id INTEGER PRIMARY KEY,
fingerprint TEXT NOT NULL
@bazo
bazo / redux-form-tut.js
Created August 23, 2016 11:58 — forked from dmeents/redux-form-tut.js
The source code for the redux form tutorial on davidmeents.com
import React, { Component } from 'react';
import { Field, reduxForm } from 'redux-form';
import { connect } from 'react-redux';
import * as actions from '../../actions';
const form = reduxForm({
form: 'ReduxFormTutorial',
validate
});
@bazo
bazo / cortana.html
Created April 12, 2016 12:29 — forked from seksenov/cortana.html
Cortana integration from a hosted web app on Windows. To do this you'll need a meta tag in your html page pointint to an xml voice command definition file on your server. You'll also need to handle the Cortana activation event in your JavaScript.
<!DOCTYPE html>
<html>
<head>
<title>Cortana Example</title>
<!--Cortana meta tag pointing to VCD file on the server-->
<meta name="msapplication-cortanavcd" content="https://mysite.com/vcd.xml"/>
</head>
<body>
</body>
@bazo
bazo / gist:f432711ea067840479dc
Created February 5, 2016 20:33 — forked from cucmberium/gist:3d7aca28753f7f45e172
Prism.Mvvm.MvvmAppBase for Universal App Platform
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Windows.ApplicationModel.Activation;
using Windows.UI.ApplicationSettings;
using Windows.ApplicationModel;
@bazo
bazo / cli
Created January 13, 2016 13:57
#!/usr/bin/env php
<?php
use Symfony\Component\Console\Application;
// Let bootstrap create Dependency Injection container.
$configurator = require __DIR__ . '/app/bootstrap.php';
$configurator->addConfig(__DIR__ . '/app/config/console.neon');
@bazo
bazo / php_mdb.rst
Created January 11, 2016 16:37 — forked from amirkdv/php_mdb.rst
How to handle MS Access MDB files in Linux with PHP5 PDO and ODBC

To be able to use PHP5 PDO with MS Access mdb files the following is required (the same applies for the PHP4 style of using odbc_X except for the obviously PDO specific requirements):

PHP ODBC module

In Linux this is achieved by intalling the php5-odbc package:

const renderBooleanFeature = (packages, title, feature) => {
let tds = [];
for (let $package of packages) {
const data = $package[1];
const code = $package[0];
if (data.hasOwnProperty(feature) && data[feature] === true) {
tds.push(
<td key={code+feature} className={code}>
<span className="glyphicon glyphicon-ok"></span>
$di->set('translator', function() use ($config, $di) {
$locale = $di->get('locale');
$whitelist = ['de', 'en'];
$fallback = ['de', 'en'];
$chainResolver = new \Kdyby\Translation\LocaleResolver\ChainResolver;//new \LocaleResolver($locale);
$localeResolver = new \LocaleResolver($locale);
$chainResolver->addResolver($localeResolver);