A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
| # NOTES | |
| # Spotify 0.9 vs 1.0 is stable, uses less resources overall and works well with Spotify Connect, SpotCommander, Local Files etc | |
| # Tested and works on Fedora 29 64-bit with GNOME, but should work on previous versions as well | |
| # The sources of the Dropbox files, which are hosted by me and the latest and greatest available, are listed above each one | |
| # No system files will be overwritten by these or used by other programs since they depend on the later Fedora versions | |
| # Make sure you copy the whole lines into Terminal | |
| # Each command is on one line and might be long | |
| # START GUIDE |
| // 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) { |
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
| #!/bin/bash | |
| # Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04 | |
| # Inspired from https://gist.github.com/faleev/3435377 | |
| # Remove any existing packages: | |
| sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev | |
| # Get the dependencies (Ubuntu Server or headless users): | |
| sudo apt-get update |
| <?xml version="1.0" encoding="utf-8"?> | |
| <resources> | |
| <!-- google's material design colours from | |
| http://www.google.com/design/spec/style/color.html#color-ui-color-palette --> | |
| <!--reds--> | |
| <color name="md_red_50">#FFEBEE</color> | |
| <color name="md_red_100">#FFCDD2</color> | |
| <color name="md_red_200">#EF9A9A</color> |
| /* | |
| * Copyright 2014 Google Inc. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| # This is a basic VCL configuration file for varnish. See the vcl(7) | |
| # man page for details on VCL syntax and semantics. | |
| # | |
| # Default backend definition. Set this to point to your content | |
| # server. | |
| # | |
| backend server1 { | |
| .host = "haber.local"; | |
| .port = "8080"; | |
| } |
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
| #!/bin/sh | |
| # Sending emails using Gmail and msmtp | |
| # Author: [Josef Jezek](http://about.me/josefjezek) | |
| # Donate: [Gittip](https://www.gittip.com/josefjezek) | |
| # Link: [Gist](https://gist.github.com/6194563) | |
| # Usage: setup-msmtp-for-gmail.sh | |
| sudo apt-get update -q | |
| sudo apt-get install msmtp-mta ca-certificates heirloom-mailx -yq |