Skip to content

Instantly share code, notes, and snippets.

View shrop's full-sized avatar
👋

Mark Shropshire shrop

👋
View GitHub Profile
@shrop
shrop / create_node.php
Last active December 20, 2015 07:58
Create a node object and save it (Drupal 7)
<?php
$node = new stdClass();
$node->type = 'content_type';
$node->title = 'Node Title';
// Set the language.
$node->language = LANGUAGE_NONE;
// Custom field.
$node->field_custom[$node->$language][0]['value'] = 'Custom field data';
@shrop
shrop / update_node.php
Last active December 20, 2015 07:58
Update a node object and save it (Drupal 7)
<?php
// Load a node with nid = 1000.
$node_nid = 1000;
$node = node_load($node_nid);
// Change the title of the node.
$node->title = 'New title';
// Update the value of a field with the language property of the node object.
$node->field_custom[$node->$language][0]['value'] = 'New custom field data';
@shrop
shrop / lol.js
Last active December 22, 2015 06:08
Node lol generator
var http = require("http");
http.createServer(function(request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
i = 0;
while (i < 100000) {
response.write("lol ");
i++;
}
response.end();
@shrop
shrop / rebuild-perms.php
Last active December 30, 2015 04:19
Rebuild permissions for running via Drush (no batch process)
<?php
/**
* @file
* Rebuild the node access database with no php time limits.
*/
/**
* Rebuilds the node access database (for use with drush php-script).
*
@shrop
shrop / intro-meteor.js.md
Last active October 1, 2022 16:54
Introduction to Meteor.js
var searchString = 'CLEAR 82LD 124OZ","Allᄄ liquid l';
var repString = searchString.replace(/Allᄄ/, "All(r)");
console.log(repString);
<?
$date = date_parse('1/1/2014');
print checkdate($date['month'], $date['day'], $date['year']);
@shrop
shrop / meteor-charlotte-20140203.md
Last active August 29, 2015 13:56
Meteor Charlotte February 3rd. 2014 Meetup Summary

Meteor Charlotte, which launched in January, held its second meetup on Monday, February 3rd. The group meets at Packard Place, which is hub for entrepreneurship and innovation in the Charlotte, North Carolina area. Between the first two meetups, attendees included those recently hearing about Meteor for the first time, startup entrepreneurs learning Meteor for API development and rapid prototyping, and a college student who has quite a bit of Meteor experience developing an app for Purdue University.

While the January meetup was an introduction to Meteor and live demos, February was all about resources. One Meteorite discussed key points of Emily Stark's Meteor security talk at github. The Meteor Podcast was brought up as a great weekly Meteor news podcast. [Crater.io](http:/