Skip to content

Instantly share code, notes, and snippets.

View coline-carle's full-sized avatar

Coline Carle coline-carle

View GitHub Profile
@-moz-document domain("lemonde.fr") {
.services, .vous, .audience, #teaser_article .bordt1, #header-page, #footer, #footer-page, #header, #en_ce_moment, #footer_services, #ultimedia_wrapper, .fb_iframe_widget, .toolbar, iframe, .conteneur_barre_outils, .meme_sujet, .liste_reactions {
display: none !important;
}
.container_18 .grid_10 {
width: 700px;
margin-left: 60px;
}
.container_18 .grid_12 {
width: 100%;
@imranismail
imranismail / queue.ex
Last active April 3, 2021 21:12
Process native queue with backpressure using Erlang's :queue and Elixir's GenStage spawning a Process for each job in queue
# Elixir :queue wrapper with modified behavior for empty queues to mimic Enumerable module in Elixir
defmodule Queue do
def insert(queue, item), do: :queue.in(item, queue)
def insert_last(queue, item), do: :queue.in_r(item, queue)
def member?(queue, item), do: :queue.member(item, queue)
def filter(queue, fun), do: :queue.filter(fun, queue)
@zcmarine
zcmarine / remap_capslock.lua
Created March 28, 2017 15:35
Hammerspoon capslock remapping: tap to Escape, hold in chord for Control
-- Inspired by https://github.com/jasoncodes/dotfiles/blob/master/hammerspoon/control_escape.lua
-- You'll also have to install Karabiner Elements and map caps_lock to left_control there
len = function(t)
local length = 0
for k, v in pairs(t) do
length = length + 1
end
return length
end
@schmich
schmich / config.bat
Last active June 3, 2025 14:15
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"
@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
@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
@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
@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)
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
@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