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)
/** | |
* Image slider with pure CSS | |
* Original version in http://demosthenes.info/blog/css | |
*/ | |
.image-slider { | |
position:relative; | |
display: inline-block; | |
line-height: 0; | |
} |
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)
<?php | |
// If you can edit pages, you can edit widgets | |
add_filter( 'user_has_cap', | |
function( $caps ) { | |
if ( ! empty( $caps['edit_pages'] ) ) | |
$caps['edit_theme_options'] = true; | |
return $caps; | |
} ); |
<!--Database custom events--> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
$('a.db_name').each(function(){ | |
var db_name = $(this).text(); | |
$(this).click(function(){ | |
_gaq.push(["_trackEvent", "linkOut", "database", db_name]); // create a custom event | |
}); | |
}); | |
}); |
The MIT License (MIT) | |
Copyright (c) 2013 Jamar Parris | |
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. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE S |
A custom Mapbox map generated by Folium. One fixed marker, one fixed circle marker. Click on the map to place a new marker, click the marker to see Lat/Lng, double-click the marker to remove it. This map was generated with the following Python code:
import folium
#Custom Mapbox Tiles
tileset = r'http://a.tiles.mapbox.com/v3/[...]/{z}/{x}/{y}.png'
attribution = (r'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a>'
' contributors, Imagery © <a href="http://mapbox.com">MapBox</a>')
#Create Map
mapbox = folium.Map(location=[45.5236, -122.6750], tiles=tileset, zoom_start=13,
This extends the built-in WordPress function get_the_ID()
to return the post ID both inside and outside the loop.
<?php if ( function_exists( 'gt_hide_nav' ) && ! gt_hide_nav() ) : ?>
<nav role="navigation">
<?php if ( function_exists( 'bones_main_nav' ) ) bones_main_nav(); ?>
</nav>
#!/usr/bin/env python | |
import apscheduler.scheduler | |
import daemon.runner | |
import os.path | |
import sys | |
import time | |
class Core(): | |
def __init__(self): |
Created by Anonymous at BootTheme
1) Install MAMP normally | |
2) Download the latest binary of tomcat from http://tomcat.apache.org/ and extract it into the MAMP folder | |
(you should now have a /Applications/MAMP/apache-tomcat-version folder) | |
3) Create a link to the apache-tomcat folder: | |
ln -s /Applications/apache-tomcat-7.0.37/ tomcat | |
4) Make sure all the binaries are executable: | |
cd /Applications/tomcat/bin |