Skip to content

Instantly share code, notes, and snippets.

View miloshavlicek's full-sized avatar
:octocat:
Let's make the world better…

Miloš Havlíček miloshavlicek

:octocat:
Let's make the world better…
View GitHub Profile
@ThYpHo0n
ThYpHo0n / .zshrc
Last active April 11, 2024 19:00
WSL(2) bash profile helpers
# WSL?
if [[ "$(< /proc/sys/kernel/osrelease)" == *microsoft* ]]; then
export $(dbus-launch)
export LIBGL_ALWAYS_INDIRECT=1
export WSL_VERSION=$(wsl.exe -l -v | grep -a '[*]' | sed 's/[^0-9]*//g')
export WSL_HOST=$(tail -1 /etc/resolv.conf | cut -d' ' -f2)
export DISPLAY=$WSL_HOST:0
# pip path if using --user
export PATH=$PATH:$HOME/.local/bin
# SSH
@fedme
fedme / Ionic Android Development on WSL.md
Last active May 7, 2023 16:21
Ionic Android Development on WSL (Windows Subsystem for Linux)

Ionic Android Development on WSL

Installing the required software

Execute the following commands to install Node, npm, git, Java, Ionic, Cordova and Angular CLI:

cd ~
sudo apt update
sudo apt upgrade

Proposal for a PSR for message translator

The main aim of this proposal is to provide a common interface for the interoperability of message translations across different packages

What is the scope?

  • Provide a way to consume message translations in different languages.
  • Allow handling plurals
  • Allow using translations from different contexts and domains
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active May 22, 2024 19:07
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@AVatch
AVatch / sift.py
Created May 9, 2016 19:11
OpenCV SIFT
import cv2
import numpy as np
from matplotlib import pyplot as plt
# Import our game board
canvas = cv2.imread('./data/box_med.jpg')
# Import our piece (we are going to use a clump for now)
piece = cv2.imread('./data/piece_small.jpg')
# Pre-process the piece
@Kedrigern
Kedrigern / HomepagePresenter.php
Last active March 26, 2016 09:20
Multiple file upload for Nette framework via HTML5 FormData (Ajax).
<?php
/**
* Homepage presenter.
*/
class HomepagePresenter extends BasePresenter
{
public function handleProcessImages()
{
$files = $this->getHttpRequest()->getFiles();
@lennart
lennart / gist:3787187
Created September 26, 2012 10:16
Web Config for Symfony 2 in WebMatrix 2
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<clear />
<rule name="TempRewriteToWeb" stopProcessing="false">
<match url="^(web/)?(.*)$" />
<action type="Rewrite" url="web/{R:2}" logRewrittenUrl="true" />
</rule>
@peterjmit
peterjmit / doctrine_cache_driver.php
Created March 6, 2012 17:47
Get the Result Cache from the doctrine entity manager
<?php
class Foo
{
private $_em;
public function __construct($entity_manager)
{
$this->_em = $entityManager;
}