Skip to content

Instantly share code, notes, and snippets.

@jboesch
jboesch / gist:1299783
Created October 19, 2011 21:44
Drag/drop for fullCalendar on iPad
/********************************
* UPDATE: I have crated a plugin to do this: https://github.com/jboesch/jQuery-fullCalendar-iPad-drag-drop/
*********************************/
/*These are the brief steps that it takes to get fullCalendar (http://arshaw.com/fullcalendar/) up and running with drag/drop support on the iPad. This assumes you already have fullCalendar setup.*/
//1. Include a copy of jQuery touch punch in your project, you can find it here: https://github.com/furf/jquery-ui-touch-punch
//2. Go into jquery-touch-punch.js and right after this line (around line 57 - mouseProto._mouseDown = function (event) {) add this: this._mouseDownEvent = event;
//3. Add this function somewhere in your global.js file or wherever you want:
@datagrok
datagrok / git-serve.md
Last active April 21, 2023 07:33
How to easily launch a temporary one-off git server from any local repository, to enable a peer-to-peer git workflow.
@drance
drance / UIViewController+BHSContainment.m
Last active September 2, 2021 00:26
Tired of the UIViewController containment three-step. Adds a convenience param if the destination superview is not actually the parent VC's main view.
@implementation UIViewController (BHSContainment)
- (void)bhs_addChildViewController:(UIViewController *)child {
[self bhs_addChildViewController:child superview:self.view];
}
// Note this potentially forces view loads on both parent and child
// Not a problem if used in -viewDidLoad or later
// Use superview parameter with care. If it's not within the parent VC's hierarchy, you deserve to lose
@algal
algal / diffs.swift
Last active July 30, 2018 09:15
diff calculator
// swift 1.2
/**
:param: old array of items
:param: new array of items
:return: a tuple where with the following components:
- `newIndexesAdded` indexes in new, for elements that did not exist in old
- `oldIndexesDeleted` indexes in old, for elements not in new
@Nelyus
Nelyus / copyCarthageFrameworks.sh
Last active September 21, 2015 14:05
Copy frameworks build by carthage to the target build dir, so Xcode can find them more easily (for exemple in playgrounds)
#!/usr/bin/env sh
# Carthage build dirs per platform
CARTHAGE_IOS_BUILD_DIR="Carthage/Build/iOS"
CARTHAGE_MAC_BUILD_DIR="Carthage/Build/Mac"
if [ "$PLATFORM_NAME" = "iphoneos" -o "$PLATFORM_NAME" = "iphonesimulator" ]; then
CARTHAGE_BUILD_DIR="$CARTHAGE_IOS_BUILD_DIR"
elif [ "$PLATFORM_NAME" = "macosx" ]; then
CARTHAGE_BUILD_DIR="$CARTHAGE_MAC_BUILD_DIR"