Skip to content

Instantly share code, notes, and snippets.

from pptx import Presentation
from pptx.util import Inches, Pt
import copy
def duplicate_slide(pres, index):
source = pres.slides[index]
try:
blank_slide_layout = pres.slide_layouts[6]
except:
blank_slide_layout = pres.slide_layouts[len(pres.slide_layouts) - 1]
@marklevi
marklevi / gist:7819239
Last active December 30, 2015 10:59
yes/no
<div id="label-switch" class="make-switch switch-mini has-switch" data-on-label="YES" data-off-label="NO">
<div class="switch-on" style=""><input type="checkbox" checked=""><span class="switch-left switch-mini">YES</span><label class="switch-mini">&nbsp;</label><span class="switch-right switch-mini">NO</span></div></div>
##################################################################################
<% event.items.order('created_at ASC').all.each do |item| %>
<tr class="<% if item.important? %>important<% end %> <% if item.important? %>purchased<% end %>">
<td><%= item.name %></td>
<td><div id="label-switch" class="make-switch switch-mini" data-on-label="YES" data-off-label="NO">
<input type="checkbox" checked></div></td>
@marklevi
marklevi / gist:7687423
Created November 28, 2013 04:59
salar helps
PageManager = {
makeClickable: function(){
$('#page-2 #answers').children().toggleClass('clickable')
},
turnOnListener: function(){
$('#answers').on('click', 'li', expectAnswer);
},
class Sudoku
def initialize(board_string)
@sudoku_grid= board_string.split('').collect{|i| i.to_i}.each_slice(9).to_a
end
def solve!
count=1
while @sudoku_grid.include?(0)
number_clearer(count)
count+=1