This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Concatenating filters: "deck:name" "is:new" "-is:suspended" //- == ! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if __name__ == "__main__": | |
reactor_args = {} | |
def run_twisted_wsgi(): | |
from twisted.internet import reactor | |
from twisted.web.server import Site | |
from twisted.web.wsgi import WSGIResource | |
resource = WSGIResource(reactor, reactor.getThreadPool(), app) | |
site = Site(resource) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
uninstall() { | |
list=`gem list --no-versions` | |
for gem in $list; do | |
gem uninstall $gem -aIx | |
done | |
gem list | |
gem install bundler | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# run as sudo to have access to /opt or change the directory | |
# check docks for additional info | |
# https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/ | |
curl -o /opt/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.2.0.1873-linux.zip | |
cd /opt/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nokogiri' | |
require 'open-uri' | |
# Get a Nokogiri::HTML:Document for the page we're interested in... | |
doc = Nokogiri::HTML(open('http://www.google.com/search?q=tenderlove')) | |
# Do funky things with it using Nokogiri::XML::Node methods... | |
#### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Order { | |
public function sendToEcommerce(){ | |
switch($this->status){ | |
case 'created': | |
$params["access_token"] = "### Chave de Acesso ###"; | |
$data["Order"]["status_id"] = $this->status_id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Product1 { | |
public function sendToMarketplace(){ | |
if ($this->marketplace == 'Amazon') { | |
//huge code block | |
} elseif ($this->marketplace == 'Via Varejo') { | |
//huge code block | |
} elseif ($this->marketplace == 'Magalu') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# * * * * * DISPLAY=:0 /usr/bin/zenity --info --text="stretch" --title="reminder" | |
# * * * * * /bin/echo "cron works" >> /tmp/file | |
# * * * * * /usr/bin/zenity --notification --text="stretch" --title="reminder" --display=:0.0 | |
# this one on top doesn't work unless we do as below | |
DISPLAY=:0.0 | |
# * * * * * eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)"; /usr/bin/notify-send "TEST" "Crons work!" | |
40 * * * * eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)"; /usr/bin/notify-send "REMINDER" "Check posture!" | |
30 10,14,17 * * * eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)"; /usr/bin/notify-send "REMINDER" "Take a break! (stretch, coffee, etc)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ruby:2.5.7 | |
RUN apt-get update && apt-get install -y cron | |
RUN apt-get install -y nano | |
COPY Gemfile* /usr/src/app/ | |
WORKDIR /usr/src/app | |
ENV BUNDLE_PATH /gems |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NilObjectUnderstadingStrategy | |
def self.can_talk_to?(character) | |
true | |
end | |
end | |
class HumanCharacterUnderstandingStrategy | |
def self.can_talk_to?(character) | |
character.is_a? Human | |
end |
OlderNewer