Skip to content

Instantly share code, notes, and snippets.

View coline-carle's full-sized avatar

Coline Carle coline-carle

View GitHub Profile
@larsch
larsch / gist:140038
Created July 3, 2009 09:58
Treetop parser for Lua objects (limited)
LUAOBJECT_GRAMMAR = %q{
grammar LuaObject
rule luaobj
space value space { def to_ruby; value.to_ruby; end }
end
rule value
nil / float / number / string / table / boolean
end
'''
redis_search.py
Written by Josiah Carlson July 3, 2010
Released into the public domain.
This module implements a simple TF/IDF indexing and search algorithm using
Redis as a datastore server. The particular algorithm implemented uses the
@otobrglez
otobrglez / Article.rb
Created July 12, 2011 20:51
Finding related articles using Jaccard index and tags
# This method finds related articles using Jaccard index (optimized for PostgreSQL).
# More info: http://en.wikipedia.org/wiki/Jaccard_index
class Article < ActiveRecord::Base
def related(limit=10)
Article.find_by_sql(%Q{
SELECT
a.*,
( SELECT array_agg(t.name) FROM taggings tg, tags t
anonymous
anonymous / MenuItem Insert
Created December 24, 2011 21:37
Wow Lua Code for inserting menu items into dropdowns
This is what I am using atm.
function MG:UnitPopup_HideButtons()
local k
local dropdownMenu = UIDROPDOWNMENU_INIT_MENU
for index, value in ipairs(UnitPopupMenus[UIDROPDOWNMENU_MENU_VALUE] or UnitPopupMenus[dropdownMenu.which]) do
if value == "METAGUILD_INVITE" then
k = (not self:CanInvite(dropdownMenu.name) or dropdownMenu.name == UnitName("player")) and 0 or 1
UnitPopupShown[UIDROPDOWNMENU_MENU_LEVEL][index] = k
@renoirb
renoirb / README.md
Last active October 4, 2017 01:05
Development environment overriding prod for manifest development

Workspace files:

workspace/salt-master/
  - Vagrantfile
  - etc/
    - salt/ 
      - master.d/
        - remotes.conf
 - NOTE: anything else that I want in ALL environments)
@vt0r
vt0r / GnuPG-2.2.md
Last active February 13, 2024 09:03 — forked from mattrude/GnuPG-2.1.md
Build/install instructions for GnuPG 2.2.x on Ubuntu and similar distros (formerly for 2.1.x)

GnuPG 2.2.x Build Instructions

Below are my build instructions for GnuPG 2.2.10, released on August 30th, 2018. These instructions are built for a headless Ubuntu 18.04 LTS server (and have also been tested on Ubuntu 14.04/16.04).

If you prefer, you may use the below install script to install GnuPG 2.2.x by running the following commands:

curl -OL "https://gist.githubusercontent.com/vt0r/a2f8c0bcb1400131ff51/raw/e0d2011d7b89bfe5b83c3f29f21949fb21354dd9/install-gnupg22.sh" && sudo -H bash ./install-gnupg22.sh

Install the needed dependencies

@andyshinn
andyshinn / Dockerfile
Created December 24, 2015 19:07
BusyBox cron container example
FROM gliderlabs/alpine:3.3
COPY myawesomescript /bin/myawesomescript
COPY root /var/spool/cron/crontabs/root
RUN chmod +x /bin/myawesomescript
CMD crond -l 2 -f
@leonelgalan
leonelgalan / codeclimate.sh
Created February 18, 2016 15:23
Setting up Code Climate with Docker/Docker Machine
: Please update Homebrew often and make sure "Your system is ready to brew."
brew update && brew doctor
: Install VirtualBox
brew tap caskroom/cask
brew cask install virtualbox
: Install/Setup Docker
brew install docker
brew install docker-machine
@arbelt
arbelt / init.lua
Created October 2, 2016 20:55
Hammerspoon config to send escape on short ctrl press
ctrl_table = {
sends_escape = true,
last_mods = {}
}
control_key_timer = hs.timer.delayed.new(0.15, function()
ctrl_table["send_escape"] = false
-- log.i("timer fired")
-- control_key_timer:stop()
end
@schmich
schmich / config.bat
Last active July 5, 2023 03:36
Forward external connections to Docker on Windows
REM In admin prompt
REM Ensure web server/application is listening on all interfaces (0.0.0.0)
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=80 connectaddress=10.0.75.2 connectport=80
netsh advfirewall firewall add rule name="App" dir=in action=allow protocol=TCP localport=80 remoteport=80
netsh interface portproxy show v4tov4
netsh advfirewall firewall show rule "App"
netsh interface portproxy delete v4tov4 listenaddress=0.0.0.0 listenport=80
netsh advfirewall firewall del rule name="App"