View soraph_range.js
const sRange = (from, to, includeUpperLimit = false) => {
/*
* Params:
*
* from: integer, first value of cycle and the Array
* to: integer, last value of the cycle
* includeUpperLimit: boolean, if true will use to as last
* element of the Array
*
* Works like Python's range() but two params are mandatory.
View about:config.md

Firefox bullshit removal

Due to the incessant swarm of complete and utter nonsense that has been forcing its way into Firefox over time, I've decided to start collecting my personal list of “must-have” about:config tweaks required to turn Firefox into a functional brower.

WebSockets

These can be used for nefarious purposes and to bypass access restrictions.

network.websocket.enabled=false
View 4chandowload.sh
curl -s http://boards.4chan.org/_______________ | grep -o -i '<a class="fileThumb" href="//i.4cdn.org\/[a-z]*\/[0-9]*\.[a-z]\{3\}' | cut -d / -f 3- |while read a; do wget -c $a; done
View template.php
<?php
function fancythemename_preprocess_image(&$variables) {
if (isset($variables['style_name'])) {
if ($variables['style_name'] == 'fancystylename')
$variables['attributes']['class'][] = 'img-thumbnail'; //bootstrap class
}
}
View magicelements.css
/*
Source: http://b.qr.ae/1rmTvEY
*/
* { background-color: rgba(255,0,0,.2); }
* * { background-color: rgba(0,255,0,.2); }
* * * { background-color: rgba(0,0,255,.2); }
* * * * { background-color: rgba(255,0,255,.2); }
* * * * * { background-color: rgba(0,255,255,.2); }
* * * * * * { background-color: rgba(255,255,0,.2); }
View environment.rb
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
if html_tag.match(/class=(\'|\")([\w\s\d]*?)\1/i)
html_tag.gsub(/class=(\'|\")([\w\s\d]*?)\1/i, 'class="\2 has-error"')
else
html_tag.gsub(/\<[\w]+/i, '\0 class="has-error"')
end
end
View my.module
function my_menu() {
$items['path/page'] = array(
'title' => t('Page title'),
'page callback' => 'mypage_callback_function',
'page arguments' => array('my','totally','optional','argumet','list'),
);
return $items;
}
// All your other module logic
View styles.css
pre {
font-family: monospace;
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
/*
padding: XX;
margin: XX;
View template.php
<?php
function yourtheme_css_alter(&$css){
$to_be_removed = array('sites/all/modules/example_module/styles/example_module_css.css' => FALSE,);
$css = array_diff_key($css,$to_be_removed);
}
View template.php
<?php
function yourtheme_js_alter(&$javascript) {
[...]your stuffs[...]
$jquery_new = drupal_get_path('theme','yourtheme') . '/js/jquery-1.10.2.min.js';
$javascript[$jquery_new] = $javascript['misc/jquery.js'];
$javascript[$jquery_new]['version'] = '1.10.2';
$javascript[$jquery_new]['data'] = $jquery_new;