Skip to content

Instantly share code, notes, and snippets.

@jj1bdx
jj1bdx / sunrise.py
Created October 6, 2009 03:42
PyEphem script to show sunrise and sunset
#!/usr/local/bin/python
# a Python script for PyEphem
# http://rhodesmill.org/pyephem/
# to find out the sunrise and sunset time
# in UTC
# (add more code for the local time by yourself)
# by Kenji Rikitake 6-OCT-2009
from datetime import datetime, timedelta
@garnaat
garnaat / iam_ec2_example.py
Created September 15, 2010 04:48
Use IAM/boto to provide access to EC2 and S3
"""
IAM boto examples:
In this example we create a group that provides access
to all EC2 and S3 resources and actions and then add a
user to that group.
"""
import boto
#
# First create a connection to the IAM service
@pksunkara
pksunkara / config
Last active June 21, 2024 08:46
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[init]
defaultBranch = master
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
@mfkp
mfkp / index.html
Created December 17, 2011 01:39
mailchimp ajax signup form example
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="jquery.ketchup.all.min.js" type="text/javascript"></script>
</head>
<body>
<div id="email">
<span>Enter your email to sign up</span>
<form action="/subscribe.php" id="invite" method="POST">
@jmdodd
jmdodd / gist:1497987
Created December 19, 2011 17:02
Filter FeedWordPress syndicated posts into custom post types
<?php
if ( ! function_exists( 'ucc_cpt_feedwordpress_syndicated_post' ) ) {
function ucc_cpt_feedwordpress_syndicated_post ( $data ) {
$feed = $data['meta']['syndication_feed'];
// Adjust stripos contents as needed.
if ( stripos( 'colourlovers.com/rss/lover/username/palettes/favorites', $feed ) !== false ) {
$data['post_type'] = 'colourlovers-palette';
} elseif ( stripos( 'colourlovers.com/rss/lover/username/colors/favorites', $feed ) !== false ) {
@pamelafox
pamelafox / tumlbr_template.html
Created April 12, 2012 19:07
Twitter Bootstrap Tumblr Theme
<!doctype html>
<!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]> <html class="no-js ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns#"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name='description' content='{MetaDescription}'>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@helgatheviking
helgatheviking / custom-post-type-archive-menu-links.php
Created May 4, 2012 17:41
Adds Custom Post Type archives to the WordPress-powered menus
<?php
/*
Plugin Name: Custom Post Type Archive Menu Links
Plugin URI: http://codeseekah.com/2012/03/01/custom-post-type-archives-in-wordpress-menus-2/
Description: Easily Add Custom Post Type Archives to the Nav Menus
Version: 1.0
Author: soulseekah
Author URI: http://codeseekah.com
License: GPL2
@billerickson
billerickson / genesis-custom-loop-pagination.php
Created July 31, 2012 15:59
Genesis custom loop with pagination
<?php
/* Template Name: Test */
/**
* Genesis custom loop
*/
function be_custom_loop() {
global $post;
// arguments, adjust as needed
@beausmith
beausmith / isotope-centered-masonry-and-masonry-gutters.js
Last active November 6, 2019 04:24 — forked from mattstauffer/gist:3835881
Isotope with Centered Masonry and Masonry Gutters.
$(function() {
// Tweaked from: https://gist.github.com/mattstauffer/3835881
// No guarantees
// 1. include Isotope.js
// 2. include this file
// 3. customize Isotope options at the bottom of this file
// 4. add "margin: 0 auto" to the isotope container
$.Isotope.prototype._getMasonryGutterColumns = function() {
@piranha
piranha / anchorify.js
Last active February 12, 2020 09:27
Anchorify.js
/*
* Anchorify without jQuery
* Rewritten from https://github.com/willdurand/anchorify.js/
*/
var anchorify = (function() {
var specialCharsRe = /[ ;,.'?!_]/g;
function generateId(text) {
return text