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
// jenkinsfile - as declarative pipeline | |
pipeline { | |
agent any | |
environment { | |
// credentials 'jenkins-db-credential' is globally accessible on jenkins | |
// | |
DB_CREDENTIAL = credentials('jenkins-db-credential') | |
DB_USER = "${env.DB_CREDENTIAL_USR}" |
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
[INCLUDES] | |
before = common.conf | |
[Definition] | |
datepattern = %%d/%%b/%%Y:%%H:%%M:%%S | |
failregex = <HOST>.*POST.*(wp-login\.php|xmlrpc\.php).* 200 |
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
apache2 nutzt auf ubuntu-bionic (18.04) PrivateTmp | |
d.h. nach jedem reboot von apache2 ändert sich dieses directory | |
um das zu umgehen entweder PrivateTmp=false in apache service file oder: | |
in jeweiliger vhosts conf: | |
PassengerInstanceRegistryDir /var/run/passenger-instance | |
in .bash_profile: |
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
namespace :deploy do | |
desc 'show kemal status' | |
task :kemal_status do | |
on roles(:app) do | |
within "#{release_path}" do | |
execute "start-stop-daemon", | |
"-v", | |
"--status", | |
"--pid", |
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
# create custom tags for redcarpet to insert youtube|vimeo iframes in | |
# your document. | |
# ::usage:: vid(youtube, 123456) | |
class VideoMarkdownRenderer < Redcarpet::Render::HTML | |
include ActionView::Helpers::AssetTagHelper | |
def preprocess(document) | |
# scans for: vid(provider, id) | |
# e.g. vid(youtube,12345) |
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
# quick'm'dirty way to allow paperclip image-ids | |
# instead of urls be passed to Redcarpet | |
# so you can do: | |
# ![title](42 'thumb|pull-right') - whereas 'thumb' is your available paperclip-style and 'pull-right' a css-class | |
# and also the knwon way: | |
# ![title](http://i.ytimg.com/vi/Z6po6SS9Uz4/maxresdefault.jpg "my alt text") | |
# all this b'cause there is no 'super' in redcarpet... | |
# | |
class PaperclipRender < Redcarpet::Render::HTML |
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
fn main() { | |
let mut txt = "Hello, World!".to_string(); // txt: String | |
println!("first its: {}", txt); | |
txt = get_pling(txt); | |
println!("then its: {}",txt); | |
add_in_place_plong(&mut txt); // passes a mutable reference | |
println!("finally its: {}", txt); |
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 @GoogleAnalytics | |
@load: -> | |
((i, s, o, g, r, a, m) -> | |
i["GoogleAnalyticsObject"] = r | |
i[r] = i[r] or -> | |
(i[r].q = i[r].q or []).push arguments | |
i[r].l = 1 * new Date() |
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 @PiwikAnalytics | |
@load: -> | |
# Piwik Analytics depends on a global _paq array. window is the global scope. | |
window._paq = [] | |
window._paq.push(['setTrackerUrl', PiwikAnalytics.trackerUrl() + '/piwik.php']) | |
window._paq.push(['setSiteId', PiwikAnalytics.siteId()]) | |
window._paq.push(['enableLinkTracking']) | |
# Create a script element and insert it in the DOM |
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
<!-- app/views/shared/_piwik_js.html.erb --> | |
<script type="text/javascript" data-turbolinks-eval=false> | |
var _paq = _paq || []; | |
_paq.push(["trackPageView"]); | |
_paq.push(["enableLinkTracking"]); | |
(function() { | |
var u=(("https:" == document.location.protocol) ? "https" : "http") + "://<%= PiwikSetup.host %>/"; | |
_paq.push(["setTrackerUrl", u+"piwik.php"]); |
NewerOlder