Skip to content

Instantly share code, notes, and snippets.

{% for post in posts %}
<div class="blog_post">
<div class="blog_col">
<a class="post_title_cell post_title" href="{{ url('node/' ~ post.nid) }}">
<h3>{{ post.title }}</h3>
<div class="comments">0 Comments</div>
</a>
<div class="cell_180x135 meta">
<h4>{{ post.date |date('M m, Y')}}</h4>
<?php namespace Studiobanks;
class Fields
{
public static function createEntity() {
// $field = entity_create('field_entity', [
// 'id' => 'field_text_slug',
// 'name' => 'field_text_slug',
// 'entity_type' => 'node',
// 'type' => 'text',
<?php
namespace Drupal\blog\Controller;
use Symfony\Component\HttpFoundation\Response;
use Drupal\Core\Controller\ControllerBase;
/**
* Controller class for the blog module.
<?php
// Case 1 Produces:
// int_of_value: 0 is equal to value: dog
$value = 'dog';
$int_of_value = (int) $value;
if ($int_of_value == $value) {
/*
@datacodesolutions
datacodesolutions / get_changed_files.sh
Created July 26, 2013 14:41
Create tar.gz file of all changed files in a given time frame.
#! /bin/sh
tar cvpzf ./test_backup.tar.gz --newer-mtime='-3 days' --exclude='.git' ./Sites/*
@datacodesolutions
datacodesolutions / process.sh
Last active December 17, 2015 05:29
View all process for given executable
pgrep php
@datacodesolutions
datacodesolutions / gist:5551786
Created May 10, 2013 01:12
kill all php process
pkill -u username php
@datacodesolutions
datacodesolutions / gist:5551066
Created May 9, 2013 22:23
Shell command to execute with no hangup (can close ssh connection and it will keep working) [nohup] Don't display output [> dev/null] Allow simultaneous script executions without having to open new shell session [&]
nohup some_command > dev/null &
@datacodesolutions
datacodesolutions / gist:5226116
Created March 23, 2013 02:16
Git settings torun on remote server when getting memory / corruption errors
#http://stackoverflow.com/questions/7362709/git-pull-fails-with-bad-pack-header-error
git config --global pack.windowMemory "100m"
git config --global pack.SizeLimit "100m"
git config --global pack.threads "1"
find $(brew --prefix)/Library/Formula -type l -name "*requirement.rb" -delete