Skip to content

Instantly share code, notes, and snippets.

View miklb's full-sized avatar
🎣
Gone Fishing

Michael Bishop miklb

🎣
Gone Fishing
View GitHub Profile
@omz
omz / New from Gist.py
Created November 15, 2012 04:52
New from Gist
### Based on: https://gist.github.com/b0644f5ed1d94bd32805
### This version strips unicode characters from the downloaded script
### to work around the currently limited unicode support of the editor
### module.
# This script downloads and opens a Gist from a URL in the clipboard.
# It's meant to be put in the editor's actions menu.
#
# It works with "raw" and "web" gist URLs, but not with gists that
# contain multiple files or non-Python files.
@omz
omz / dropboxlogin.py
Created November 7, 2012 21:16
dropboxlogin
# YOU NEED TO INSERT YOUR APP KEY AND SECRET BELOW!
# Go to dropbox.com/developers/apps to create an app.
app_key = 'YOUR_APP_KEY'
app_secret = 'YOUR_APP_SECRET'
# access_type can be 'app_folder' or 'dropbox', depending on
# how you registered your app.
access_type = 'app_folder'
@ttscoff
ttscoff / ddhack.md
Created June 4, 2012 18:14
DuckDuckHack/DuckDuckGo news

This is probably posted elsewhere, but I didn't see it. Cool stuff for DuckDuckGo users, just in case you don't subscribe to the newsletter.


Dear DuckDuckGo friends,

Last month we launched DuckDuckHack, our open source platform that enables developers to create instant answer plugins on DuckDuckGo: http://duckduckhack.com/.

The following are the plugins we launched via the platform in the past few weeks.

@norcross
norcross / rkv_referr_source
Created March 30, 2012 18:00
Add referring site to Gravity Forms
function rkv_referr_source() { ?>
<script type="text/javascript">
// build function for cookie process
function rkv_grab_cookie() {
// check document referrer
if (document.referrer !== '')
var rkv_val = document.referrer;
@luetkemj
luetkemj / wp-query-ref.php
Last active April 6, 2025 09:15
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@luetkemj
luetkemj / style.css
Created March 9, 2012 16:32
WP-CSS: Wordpress classes
/* =============================================================================
WordPress WYSIWYG Editor Styles
========================================================================== */
.entry-content img {
margin: 0 0 1.5em 0;
max-width: 100%;
height: auto;
}
.alignleft, img.alignleft {
@ringmaster
ringmaster / gist:1901070
Created February 24, 2012 13:53
jQuery browser version detection
var userAgent = navigator.userAgent.toLowerCase();
jQuery.browser = {
version: (userAgent.match( /.+(?:rv|it|ra|ie|me|on)[\/: ]([\d.]+)/ ) || [])[1],
chrome: /chrome/.test( userAgent ),
safari: /webkit/.test( userAgent ) && !/chrome/.test( userAgent ),
webkit: /webkit/.test( userAgent ),
opera: /opera/.test( userAgent ),
msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
@dandenney
dandenney / dabblet.css
Created December 30, 2011 18:51
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
.box-wrapper {
padding: 100px; }
.info {
width: 600px; }
@ttscoff
ttscoff / indent-to-ul.rb
Created December 7, 2011 14:02
Indented or Markdown list to HTML Unordered List
#!/usr/bin/ruby
# ruby script to make an unordered list from indented data.
data = %x{__CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 pbpaste}.strip
result = "<ul>\n"
last_leading_space = ""
g_tab_width = 4
anonymous
anonymous / wp-image-crop-position.php
Created November 29, 2011 18:24
WordPress: Set an image's crop position and rotates based on EXIF information if necessary
<?php
bt_add_image_size( 'product-screenshot', 300, 300, array( 'left', 'top' ) );
bt_add_image_size( 'product-feature', 460, 345, array( 'center', 'top' ) );
add_filter( 'intermediate_image_sizes_advanced', 'bt_intermediate_image_sizes_advanced' );
add_filter( 'wp_generate_attachment_metadata', 'bt_generate_attachment_metadata', 10, 2 );
/**
* Registers a new image size with cropping positions
*