Skip to content

Instantly share code, notes, and snippets.

View mac2000's full-sized avatar

Alexandr Marchenko mac2000

View GitHub Profile
@mac2000
mac2000 / gist:0a2678826034249aba0d
Created June 28, 2014 08:51
Vagrant 1.6.3 debug log on ghuntley/WindowsServer2012R2Datacenter box under Hyper-V
INFO global: Vagrant version: 1.6.3
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_EXECUTABLE="C:\\HashiCorp\\Vagrant\\embedded\\gems\\gems\\vagrant-1.6.3\\bin\\vagrant"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="C:\\HashiCorp\\Vagrant\\embedded"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_INTERNAL_BUNDLERIZED="1"
INFO global: VAGRANT_LOG="debug"
INFO global: Plugins:
# Install ttfautohint on Ubuntu 12.04 LTS
# @author: Jean Lescure
# 2014/04/23
# Clone ttfautohint git repo to 'tmp' dir and cd into resulting repo folder
cd /tmp
git clone git://repo.or.cz/ttfautohint.git
cd ttfautohint
# Handle bootstrap's dependency: automake
@mac2000
mac2000 / BoxStarter.txt
Last active August 29, 2015 14:21
BoxStarter sample
# Invoke using following syntax:
# http://boxstarter.org/package/url?[raw link to this gist]
# Boxstarter options
$Boxstarter.PackageName = "powershell4"
$Boxstarter.Version = "1.0.0"
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
@mac2000
mac2000 / Boxstarter.ps1
Last active November 3, 2015 12:59
Boxstarter sample
Set-ExplorerOptions -showFileExtensions
Enable-RemoteDesktop
choco install googlechrome -y
choco install sublimetext3 -y
choco install skype -y
@mac2000
mac2000 / sample.json
Last active December 15, 2015 08:28
Sample movies data
[
{
"Title": "Chappie",
"Year": 2015,
"imdbRating": 6.9,
"Genre": ["Action", "Crime", "Sci-Fi"]
},
{
"Title": "Star Wars: The Force Awakens",
"Year": 2015,
@mac2000
mac2000 / Version1.php
Created September 4, 2013 15:22
Doctrine Migrations Example, without command line console aplication, that could be run from command line and from web browser
<?php # src/Acme/Migrations/Version1.php
namespace Acme\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Class Version1
*
* Notice that file and class names MUST be Version*.php
@mac2000
mac2000 / slugify_speed_tests.php
Created January 15, 2014 10:39
Speed tests for different slugify methods
<?php
class PregReplaceSlugify
{
public $rules = array(
'/º|°/' => 0,
'/¹/' => 1,
'/²/' => 2,
'/³/' => 3,
'/æ|ǽ|ä/' => 'ae',
@mac2000
mac2000 / cloudSettings
Last active February 18, 2017 18:35
Visual Studio Code Sync Settings Gist
{"lastUpload":"2017-02-18T18:35:28.986Z","extensionVersion":"v2.4.3"}
@mac2000
mac2000 / sql 2017 graph demo.sql
Created August 13, 2017 17:44
sql 2017 graph demo
-- docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=P@ssword" -e "MSSQL_PID=Developer" --cap-add SYS_PTRACE -p 1433:1433 --name sql -it --rm -v C:/Users/AlexandrM/Downloads/ml-100k:/ml-100k -v C:/Users/AlexandrM/Downloads/ml-20m:/ml-20m microsoft/mssql-server-linux
-- http://files.grouplens.org/datasets/movielens/ml-20m.zip
use master;
go
DROP DATABASE movies;
GO
-- Create a graph demo database
CREATE DATABASE movies;
@mac2000
mac2000 / bigquery_cf.sql
Created August 19, 2017 18:47
bigquery recommendations based on user ratings
WITH d AS (
-- should return (cid - user id, vid - item id, rating)
SELECT
clientId as cid,
REGEXP_EXTRACT(page.pagePath, r'/company\d+/vacancy(\d+)') AS vid,
MAX(
CASE
WHEN page.pagePath LIKE '%apply=thanks%' THEN 5
WHEN page.pagePath LIKE '%mode=apply%' THEN 2