Skip to content

Instantly share code, notes, and snippets.

View kikobr's full-sized avatar
🤔

Kiko Herrschaft kikobr

🤔
View GitHub Profile
@kikobr
kikobr / insert-inside-console.js
Created October 13, 2017 02:19
Auto-accept video calls in Skype Web
function isHidden(el) {
return (el.offsetParent === null)
}
interval = (function(){
return setInterval(function(){
try {
var acceptVideoButton = document.querySelector('.toast.extended [data-click="acceptWithVideo"]');
if(acceptVideoButton && !isHidden(acceptVideoButton)){
console.log('call incoming! triggering click!');
acceptVideoButton.click();
@kikobr
kikobr / Undo.html
Created July 19, 2017 18:53
Data store undo / redo
<!DOCTYPE html>
<html>
<head>
<title>Undo</title>
</head>
<body>
<label>
Nome e sobrenome
<input type="text" id="firstName">
<input type="text" id="lastName">
@kikobr
kikobr / jquery-plugin.js
Created November 20, 2014 20:56
jQuery Plugin Boilerplate
(function ( $ ) {
$.fn.greenify = function( options ) {
// This is the easiest way to have default options.
var settings = $.extend({
// These are the defaults.
color: "#556b2f",
backgroundColor: "white"
}, options );
// Greenify the collection based on the settings variable.
return this.css({
@kikobr
kikobr / filterGun.html
Last active August 29, 2015 14:03
filterGun - filtering dynamic content easily
<input type="text" class=".search-input">
<ul class="to-search">
<li>Apples</li>
<li>Penguins</li>
<li>Turtles</li>
</ul>
<script type="text/javascript">
$(function(){
$('.search-input').filterGun({
@kikobr
kikobr / create-nimation.scss
Last active November 30, 2022 15:57
Sass
@mixin create-anim($name) {
@-moz-keyframes #{$name} { @content; };
@-webkit-keyframes #{$name} { @content; };
@-ms-keyframes #{$name} { @content; };
@-o-keyframes #{$name} { @content; };
@keyframes #{$name} { @content; };
}
@kikobr
kikobr / validate-email.js
Created February 13, 2014 19:19
Validate Email Js
re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
re.test($('.reset-password.front input'));
@kikobr
kikobr / envia-email.php
Created December 13, 2013 17:31
Envio de email
<?php
$nome = $_POST['nome'];
$email = $_POST['email'];
$telefone = $_POST['telefone'];
$mensagem = $_POST['mensagem'];
$to = "email@dominio.com.br";
$subject = "Assunto do E-mail";
$message = "Nome: ".$nome."<br/>";
$message .= "Email: ".$email."<br/>";
@kikobr
kikobr / sanfona.js
Last active December 31, 2015 00:39
Sanfona
var sanfona_speed = 200;
$(document).on('click', '[name=sanfona],[data-name=sanfona]', function(e){
e.preventDefault();
item_parent = $(this).parent();
item_content = $(this).siblings('[data-sanfona]') ? $(this).siblings('[data-sanfona]') : $(this).find('[data-sanfona]');
if(item_content && item_content.outerHeight() == 0){
height = item_content[0].scrollHeight;
// Terminada a animação, seta o height:auto para que as sublistas não sejam escondidas pela altura definida da possível sanfona pai.
item_content.animate({ height: height }, sanfona_speed, function(){
item_content.css('height', 'auto');
@kikobr
kikobr / Terminal
Created December 6, 2013 05:18
CoffeeScript
coffee --watch --compile --output src/ lib/ //Primeiro o final, depois a origem do .coffee
@kikobr
kikobr / mini-galeria.css
Last active December 30, 2015 06:29
Mini-Galeria Produtos
#produto-preview, .thumb {
display:inline-block;
vertical-align:top;
-moz-box-sizing: border-box;
-o-box-sizing: border-box;
-ms-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
#produto-preview img { width: 100%; } /* Todas as imagens ajustam às boxes */