Skip to content

Instantly share code, notes, and snippets.

View timonweb's full-sized avatar

Timur timonweb

View GitHub Profile

Awesome PHP Libraries

A list of amazingly awesome PHP libraries that you should consider using (and some other shiny extras).

{% block collection_widget %}
{% spaceless %}
<div class="collection">
{% if prototype is defined %}
{% set attr = attr|merge({'data-prototype': block('collection_item_widget') }) %}
{% endif %}
<div {{ block('widget_container_attributes') }}>
{{ form_errors(form) }}
<ul>
{% for rows in form %}
@timonweb
timonweb / gist:5990901
Created July 13, 2013 14:27
View to manage comments in bulk
$view = new view();
$view->name = 'comments_admin';
$view->description = '';
$view->tag = '';
$view->base_table = 'comment';
$view->human_name = 'Comments Admin';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
BeautifulSoup==3.2.1
Cython==0.16
Django==1.5.1
MySQL-python==1.2.3
PIL==1.1.7
South==0.8.1
Whoosh==2.4.0
argparse==1.2.1
certifi==0.0.8
django-activity-stream==0.4.5beta1
@timonweb
timonweb / README.txt
Last active December 20, 2015 12:39
Truncate string on a word boundary
Views Exposed Forms Ajax Support
================================
Adds #ajax support to Views Exposed Forms.
Since Views Exposed Forms are $_GET forms only, #ajax callbacks won't work there by default.
This module adds this ability. Just enable it and create your #ajax callbacks for any exposed form
element.
This module is the adopted version of the patch here: https://drupal.org/node/1183418, hopefully it will
be submitted to Views soon and you won't need this module anymore, but for now it will save you.
@timonweb
timonweb / smart_truncate
Created August 1, 2013 17:00
Truncate string on a word boundary
def smart_truncate(content, length=100, suffix='...'):
if len(content) <= length:
return content
else:
return ' '.join(content[:length+1].split(' ')[0:-1]) + suffix
@timonweb
timonweb / hello
Created October 8, 2013 11:42 — forked from HaBaLeS/kylog.py
print 'Hello world'
@timonweb
timonweb / jquery.nupoll
Last active December 25, 2015 16:49
JS code for jquery plugin tutorial from here: https://tutsplus.com/lesson/summary-2/
;(function($) {
var defaults = {
question: "Which is favourite JavaScript library",
ajaxOptions: {
url: "/poll.asmx/updateVotes",
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: "json"
},
@timonweb
timonweb / gist:7829056
Created December 6, 2013 17:44
Prevent Content From Breaking Out of Container
fieldset {
-ms-word-break: break-all;
word-break: break-all;
/* Non standard for webkit */
word-break: break-word;
-webkit-hyphens: auto;
-moz-hyphens: auto;
-ms-hyphens: auto;
<?php
/**
* @file
* zukunft_search_ft.views_default.inc
*/
/**
* Implements hook_views_default_views().
*/
function zukunft_glue_views_default_views() {