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
''' | |
Permission is hereby granted, free of charge, to any person obtaining a | |
copy of this software and associated documentation files (the "Software"), | |
to deal in the Software without restriction, including without limitation | |
the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
and/or sell copies of the Software, and to permit persons to whom the | |
Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in | |
all copies or substantial portions of the Software. |
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
javascript:(function()%7B%2F*https%3A%2F%2Fhackernoon.com%2Fcopying-text-to-clipboard-with-javascript-df4d4988697f*%2Fconst%20copyToClipboard%20%3D%20str%20%3D%3E%20%7Bconst%20el%20%3D%20document.createElement('textarea')%3Bel.value%20%3D%20str%3Bel.setAttribute('readonly'%2C%20'')%3Bel.style.position%20%3D%20'absolute'%3Bel.style.left%20%3D%20'-9999px'%3Bdocument.body.appendChild(el)%3Bel.select()%3Bdocument.execCommand('copy')%3Bdocument.body.removeChild(el)%3B%7D%3Bvar%20names%20%3D%20%5B%5D%3B%20for%20(var%20item%20of%20document.querySelectorAll(%22.UFICommentActorName%22))%7Bnames.push(item.innerText.split(%22%20%22)%5B0%5D)%7D%3BcopyToClipboard(names.join('%2C'))%7D)() | |
javascript:(function(){ | |
/*https://hackernoon.com/copying-text-to-clipboard-with-javascript-df4d4988697f*/ | |
const copyToClipboard = str => { | |
const el = document.createElement('textarea'); | |
el.value = str; | |
el.setAttribute('readonly', ''); | |
el.style.position = 'absolute'; | |
el.style.left = '-9999px'; |
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
// Copy a zero width whitespace to the clipboard | |
// Adds a element to the document, selects it, adds it to the clipboard and removes it | |
// Source: https://stackoverflow.com/questions/5046972/copy-text-to-clipboard-from-bookmarklet | |
javascript:!function(a){var b=document.createElement("textarea"),c=document.getSelection();b.textContent=a,document.body.appendChild(b),c.removeAllRanges(),b.select(),document.execCommand("copy"),c.removeAllRanges(),document.body.removeChild(b)}(""); | |
// Add Proper Quotation Marks | |
// Adds quotations marks around selected text | |
// Source https://stackoverflow.com/questions/40584878/how-to-create-a-js-bookmarklet-to-insert-fixed-text-at-cursor-position | |
javascript:(function(a){a.value=a.value.slice(0,a.selectionStart)+"„"+a.value.slice(a.selectionStart,a.selectionEnd)+"“"+a.value.slice(a.selectionEnd);})(document.activeElement); |
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 new List | |
// Choose Manage List -> Edit List | |
// Scroll to bottom of friends. | |
// Execute code | |
var friends = document.querySelectorAll('.friendListItem'); | |
for (var i = 0; i < friends.length; i++) { | |
friends[i].click(); | |
} |
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
// collect all links to remove the apps | |
var delete_links = document.querySelectorAll('#delete-link'); | |
//click all collected links | |
for (var i = 0; i < delete_links.length; i++) { | |
delete_links[i].click(); | |
} | |
//wait five seconds for the confirmation boxes to load | |
//and click all confirmation boxes to remove the apps |
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
Play the first html video faster (eg. on Facebook): javascript:(function(){document.getElementsByTagName('video')[0].playbackRate += 0.5})(); | |
Play the first html video slower: javascript:(function(){document.getElementsByTagName('video')[0].playbackRate -= 0.5})(); |
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
''' | |
Replace base_url, access_token and user_id | |
''' | |
import requests | |
base_url = 'https://vis.social/api/v1/' | |
# https://takahashim.github.io/mastodon-access-token/ | |
access_token = '###' | |
# which followers to visualize |
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
import tweepy; | |
consumer_key = 'KEYHERE' | |
consumer_secret = 'SECRETHERE' | |
access_token = 'TOKENHERE' | |
access_token_secret = 'TOKESECRETHERE' | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) | |
auth.set_access_token(access_token, access_token_secret) | |
api = tweepy.API(auth) |
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
Ein paar Excel-Formeln, die ich immer wieder beim Auswerten von Tweets nutze. | |
=DATUM(RECHTS(H2,4),MONAT(DATWERT(1 & TEIL(H2,5,3))),TEIL(H2,9,2)) | |
=ZEITWERT(TEIL(H2,12,8)) | |
=DATUM(RECHTS(H2,4),MONAT(DATWERT(1&TEIL(H2,5,3))),TEIL(H2,9,2))+ZEITWERT(TEIL(H2,12,8)) | |
=WENN(IDENTISCH(TEIL(F2,1,2),"RT"),"RT","Tweet") | |
=WENN(IDENTISCH(TEIL(E2,1,1),"@"), "Reply", WENN(IDENTISCH(TEIL(E2,1,2),"RT"),"RT","Tweet")) | |
=WENN(ISTZAHL(SUCHEN("dieblauen",F2)),"vorhanden","nicht vorhanden") | |
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
//Loosly based on https://github.com/CodingTrain/Rainbow-Code/blob/b22fb09f6eb3e403c3efff370dab42c104a33d35/CodingChallenges/CC_57_Earthquake_Viz/sketch.js | |
var clat = 0; | |
var clon = 0; | |
var ww = 1024; | |
var hh = 512; | |
var zoom = 1; | |
var tweets; |