Skip to content

Instantly share code, notes, and snippets.

@mareksotak
mareksotak / app-javascript-controller-hello_controller.js
Created October 24, 2023 04:41
Rails 7 - Vue 3 - Stimulus controller
import { Controller } from "@hotwired/stimulus"
import { createApp } from "vue"
import App from "../hello/App.vue"
export default class extends Controller {
connect() {
this.app = createApp(App);
this.app.mount(this.element);
}
disconnect() {
@mareksotak
mareksotak / index.html
Created November 22, 2020 11:21
Simple clock
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>A simple clock</title>
</head>
<body translate="no" >
@mareksotak
mareksotak / widget.css
Created April 5, 2017 18:14
Widget style
body .inmplayer-trigger {
bottom: 18px !important;
right: 20px;
background-color: #f0f0f0;
color: #fff;
width: 60px;
height: 60px;
transition: box-shadow 80ms ease-in-out !important;
box-shadow: 0 1px 6px rgba(0,0,0,0.06),0 2px 32px rgba(0,0,0,0.16) !important;
border-radius: 100%;
@mareksotak
mareksotak / fresh.css
Created April 12, 2016 09:58
Fresh css
.inmplayer-launcher{
background-color: #006699;
}
.connect-email-launcher{
position: absolute;
top: -30px;
left: 775px;
border: 2px solid #333;
}
.import-leads-launcher{
@mareksotak
mareksotak / anonymous_trigger_topic.js
Last active April 7, 2016 09:25
Launch a topic for anonymous users - set cookie they have seen it
if (/(^|;)\s*visited=/.test(document.cookie)) {
// seen the tutorial, do nothing
} else {
document.cookie = "tutorialSeen=true; max-age=" + 60 * 60 * 24 * 10; // 60 seconds to a minute, 60 minutes to an hour, 24 hours to a day, and 10 days.
inline_manual_player.activateTopic(1234); // 1234 is the topic id
}
@-webkit-keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.inmplayer-popover {
inline_manual_player.setCallbacks({
onStepShow: function (player, topic_id, step_id) {
console.log(player.topics[topic_id].steps.length);
}
});
.inmplayer-trigger {
right: -52px;
}
.inmplayer-launcher::before {
content: "TAKE A TOUR";
top: 0;
left: 0;
color: #000;
display: block;
height: 20px;
width: 100px;
text-indent: 0;
}
@mareksotak
mareksotak / template.php
Last active August 29, 2015 14:10
FB Commons - making the Like button look like link
<?php
/**
* These functions should be in template.php of your theme
* Just replace commons_origins with your theme name
*/
/**
* Implements hook_preprocess_rate_template_commons_like().
*/
function commons_origins_preprocess_rate_template_commons_like(&$variables, $hook) {