Skip to content

Instantly share code, notes, and snippets.

View danielbehrendt's full-sized avatar

Daniel Behrendt danielbehrendt

View GitHub Profile
curl -s https://myurl.com/script.sh | bash /dev/stdin param1 param2
@danielbehrendt
danielbehrendt / 0_reuse_code.js
Created April 21, 2016 11:40
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
/*
* Usage for a custom post type named 'movies':
* unregister_post_type( 'movies' );
*
* Usage for the built in 'post' post type:
* unregister_post_type( 'post', 'edit.php' );
*/
function unregister_post_type( $post_type, $slug = '' ){
<?php
// Controller
//
// Company fields => address_id, idenity_id
//
public function actionCreate()
{
$model = new Company;
/*\
Animate collapsible set;
\*/
$(document).one("pagebeforechange", function () {
// animation speed;
var animationSpeed = 200;
function animateCollapsibleSet(elm) {
$window = $(window);
$('section').each(function(){
var $this = $(this); // assigning the object
var off = $this.offset().top;
$this.data("top", off);
$(window).bind('resize scroll', function() {
$("#check-all").click(function() {
$(':checkbox').each(function() {
this.checked = !this.checked;
});
});
@danielbehrendt
danielbehrendt / Asset.txt
Created March 1, 2013 13:16
Flush DNS Mountain Lion
sudo killall -HUP mDNSResponder
//Create store and moc:
NSURL *baseURL = [NSURL URLWithString:myUrl];
RKObjectManager *objectManager = [RKObjectManager managerWithBaseURL:baseURL];
//not sure what this does but it's in example project
NSManagedObjectModel *managedObjectModel = [NSManagedObjectModel mergedModelFromBundles:nil];
RKManagedObjectStore *managedObjectStore = [[RKManagedObjectStore alloc] initWithManagedObjectModel:managedObjectModel];
objectManager.managedObjectStore = managedObjectStore;
NSString *modelPath = nil;
@danielbehrendt
danielbehrendt / Twitter Bootstrap Radio Button Form Inputs.html
Created December 7, 2012 09:56 — forked from kris-g/Twitter Bootstrap Radio Button Form Inputs.html
Clean way to bind result value of bootstrap radio buttons to a single form input
<form>
<div class="btn-group" data-toggle-name="is_private" data-toggle="buttons-radio" >
<button type="button" value="0" class="btn" data-toggle="button">Public</button>
<button type="button" value="1" class="btn" data-toggle="button">Private</button>
</div>
<input type="hidden" name="is_private" value="0" />
</form>