Skip to content

Instantly share code, notes, and snippets.


Craig Marvelley craigmarvelley

View GitHub Profile
View linked_notebooks.php
$token = 'YOUR TOKEN HERE';
$client = new \Evernote\Client($token, false);
$advancedClient = $client->getAdvancedClient();
$noteStore = $advancedClient->getNoteStore();
orta / Podfile.ruby
Created Oct 22, 2015
make frameworks the same as your bundle id
View Podfile.ruby
post_install do |installer|
app_plist = "Emergence/Info.plist"
plist_buddy = "/usr/libexec/PlistBuddy"
version = `#{plist_buddy} -c "Print CFBundleShortVersionString" #{app_plist}`.split
puts "Updating CocoaPods' version numbers to #{version}"
installer.pods_project.targets.each do |target|
`#{plist_buddy} -c "Set CFBundleShortVersionString #{version}" "Pods/Target Support Files/#{target}/Info.plist"`
View Simple Scrolling UIStackView
// SimpleScrollingStack.swift
// A super-simple demo of a scrolling UIStackView in iOS 9
// Created by Paul Hudson on 10/06/2015.
// Learn Swift at
// @twostraws
import UIKit
everzet / behat.yml
Created Mar 31, 2014
Registering custom context initializers with behat 3
View behat.yml
custom_extension.php: ~
shaharke / ec2_protect.yml
Created Mar 15, 2014
Protecting your production EC2 instanced from termination with Ansible
View ec2_protect.yml
- hosts: all
- name: Gather EC2 facts
action: ec2_facts
- name: Turning on termination protection
local_action: command aws ec2 modify-instance-attribute --region {{ ansible_ec2_placement_region }} --instance-id {{ ansible_ec2_instance_id }} --attribute disableApiTermination --value true
steipete / PSPDFUIKitMainThreadGuard.m
Last active Nov 8, 2021
This is a guard that tracks down UIKit access on threads other than main. This snippet is taken from the commercial iOS PDF framework, but relicensed under MIT. Works because a lot of calls internally call setNeedsDisplay or setNeedsLayout. Won't catch everything, but it's very lightweight and usually does the job.You might n…
View PSPDFUIKitMainThreadGuard.m
// Taken from the commercial iOS PDF framework
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
// Licensed under MIT (
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
// PLEASE DUPE rdar://27192338 ( if you would like to see this in UIKit.
#import <objc/runtime.h>
#import <objc/message.h>
bjo3rnf / EntityHiddenType.php
Last active Nov 19, 2021
Hidden field for Symfony2 entities
View EntityHiddenType.php
namespace Dpn\ToolsBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Dpn\ToolsBundle\Form\DataTransformer\EntityToIdTransformer;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Doctrine\Common\Persistence\ObjectManager;
iegik /
Last active Nov 6, 2021 — forked from luisfaceira/
Oneliner to convert svn:ignore into .gitignore
cat .gitignore | sed 's/^/\.\//g;s/\(.*\)\/\([0-9a-zA-Z\*\?\.]*\)$/svn propedit svn:ignore "\2" \1 /mg' | bash
Ocramius / User.php
Last active Nov 15, 2021
Doctrine 2 ManyToMany - the correct way
View User.php
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
* @ORM\Entity()
* @ORM\Table(name="user")
class User
rajraj /
Created Jan 3, 2012 — forked from aaronshaf/
Install ElasticSearch on CentOS 6
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk.i686 -y
wget -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share