Skip to content

Instantly share code, notes, and snippets.

View alexsilva's full-sized avatar
🏠
Working from home

Alex alexsilva

🏠
Working from home
View GitHub Profile
@ChadJPetersen
ChadJPetersen / InstallXapianOnWindowsWithRuby.sh
Last active October 24, 2023 21:39
After hours of slaving I finally got Xapian working on windows with a ruby binding (I use it for Redmine). I know this is far from the right way to do it, and is rather hacky. But it works! Also I found little starting points online when trying to compile Xapian on windows. So hoping this helps someone else a bit!
#In Powershell.
# Install chocolatey https://chocolatey.org/install to be the software package manager. Right now the following line is the installer. But it would be good to go grab the new command from the site provided.
#Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install git ghostscript xpdf-utils gnuwin 7zip cyg-get msys2 graphviz activeperl
choco install ruby --version=2.6.5.1
# This sets up ruby to be a dev kit
ridk install 1
cyg-get install catdoc unrtf unzip antiword xlsx2csv libvisio-tools
@fabtho
fabtho / save_screenshot.py
Last active December 12, 2022 08:07
make full screenshot with selenium in python
#!/usr/bin/python
from selenium import webdriver
from PIL import Image
from cStringIO import StringIO
verbose = 1
browser = webdriver.Firefox()
browser.get('http://stackoverflow.com/questions/37906704/taking-a-whole-page-screenshot-with-selenium-marionette-in-python')
@sim642
sim642 / boost-windows.md
Last active February 7, 2024 16:43
Installing boost libraries for GCC (MinGW) on Windows

Installing boost libraries for GCC (MinGW) on Windows

Folder setup

  1. Extract downloaded boost source, e.g. C:\Program Files\boost_1_59_0.
  2. Create a folder for Boost.Build installation, e.g. C:\Program Files\boost-build.
  3. Create a folder within for building, i.e. C:\Program Files\boost_1_59_0\build.
  4. Create a folder for installation, e.g. C:\Program Files\boost.

GCC setup

  1. Open Command Prompt.
@rdeavila
rdeavila / git-update-fork.sh
Last active February 19, 2024 16:02
Git: como atualizar um fork com as mudanças do original?
#!/bin/bash
# Adicione um novo remote; pode chamá-lo de "upstream":
git remote add upstream https://github.com/usuario/projeto.git
# Obtenha todos os branches deste novo remote,
# como o upstream/master por exemplo:
git fetch upstream
@georgevreilly
georgevreilly / mysql-python-virtualenv.bat
Created January 15, 2014 21:24
Copy MySQL-Python into a Windows virtualenv.
@REM adapted from http://stackoverflow.com/a/20092578
if ["%VIRTUAL_ENV%"]==[""] echo Must run under a Virtualenv && goto :error
set SRCDIR=c:\Python27\Lib\site-packages
pushd "%VIRTUAL_ENV%\Lib\site-packages"
xcopy /ydfsi %SRCDIR%\MySQLdb MySQLdb
xcopy /ydfsi %SRCDIR%\_mysql* .
xcopy /ydfsi %SRCDIR%\MySQL_python-1.2.3-py2.7.egg-info MySQL_python-1.2.3-py2.7.egg-info
popd
goto :eof
@luizkowalski
luizkowalski / highchartslang
Created June 11, 2012 19:40
Configurar o highcharts em pt-br
Highcharts.setOptions({
lang: {
months: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'],
weekdays: ['Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado'],
loading: ['Atualizando o gráfico...aguarde']
}
});
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
"""
Thread-safe Django cache backend for pylibmc.
Tested on Python 2.6, should work on 2.5 as well.
Use it by setting CACHE_BACKEND in settings.py, e.g.:
CACHE_BACKEND = 'projdir.utils.pylibmcd://127.0.0.1:11211/'
And here's how to properly install pylibmcd in Ubuntu for mod_wsgi: