The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Original post
// Center anything horizontally, vertically or both (assuming that the parents position is set to relative) | |
// Codepen Example Usage: https://codepen.io/anon/pen/yPbgYW | |
@mixin center($center: 'all') { | |
position: absolute; | |
@if $center == 'all' { | |
top: 50%; | |
left: 50%; | |
transform: translate(-50%, -50%); |
$(function() { | |
var collect_chat_completed = Cookies.get('collect_chat_completed'); | |
if (collect_chat_completed == "true" && !Cookies.get('collect_chat_timer')) { | |
Cookies.set('collect_chat_timer', 'true', { expires: 1 }); | |
Cookies.set('collect_chat_completed', 'true', { expires: 1 }); | |
Cookies.set('collect_chat_closed', 'true', { expires: 1 }); | |
} | |
if (Cookies.get('collect_chat_completed') == "true") { | |
$('#collect-chat-launcher').hide(); | |
} |
var delete_action_el = "btn primary-btn delete-action"; | |
var delete_button_el = "js-actionDelete"; | |
// Scroll | |
setInterval(function () { | |
window.scrollTo(0, document.body.scrollHeight); | |
}, 1000); | |
var _tweets = document.getElementsByClassName(delete_button_el); |
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
import time | |
import random | |
import sys | |
def print_same_line(text): | |
sys.stdout.write('\r') | |
sys.stdout.flush() |
// 1. go to your twitter feed with tweets and replies | |
// for example, mine was twitter.com/6a68/with_replies | |
// 2. scroll all the way down to the bottom of the page. | |
// I suppose you could automate this with JS, but I didn't. | |
// this function will delete tweets you can delete, i.e. not retweets: | |
function deleteTweets() { | |
// find the next delete button in the DOM (next deletable tweet) | |
// and click the delete button. I wanted to keep the first tweet, | |
// which is why the index here is 1. | |
if (!$('.js-actionDelete').length) { |
<?php | |
/** | |
* Adds Schema pieces to our output. | |
* | |
* @param array $pieces Graph pieces to output. | |
* @param \WPSEO_Schema_Context $context Object with context variables. | |
* | |
* @return array $pieces Graph pieces to output. | |
*/ |
import Router from 'next/router' | |
import React from 'react' | |
const DONE_DURATION = 250 | |
export const RouteIndicator = () => { | |
const [loading, setLoading] = React.useState(null) | |
const [timeoutId, setTimeoutId] = React.useState(null) | |
const onLoad = () => setLoading(true) |