This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"extra": { | |
"violinist": { | |
"bundled_packages": { | |
"drupal/core-recommended": [ | |
"drupal/core-composer-scaffold" | |
] | |
}, | |
"blacklist": [ | |
"drupal/core-composer-scaffold" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub vcl_recv { | |
# ... some other stuff and logic. | |
# This is so special I keep it in a separate if block. | |
if (req.http.host == "orkjern.com") { | |
# These first lines are based on lullabot's setup. Google it. | |
set req.http.Cookie = ";" + req.http.Cookie; | |
set req.http.Cookie = regsuball(req.http.Cookie, "; +", ";"); | |
# This cookie gets set from javascript. | |
if (req.http.Cookie ~ "ORKJERN_THEME_CACHE") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#someid").click(function() { | |
navigator.camera.getPicture(picsuccess, onfail, { quality: 50 }); | |
}); | |
function picsuccess (data) { | |
url = "http://example.com/endpoint"; // Your services endpoint | |
var data = { | |
"file": data, | |
"filename": "test.jpg" | |
}; | |
drupalServicesPostFile(data, url, postwith); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#someid").click(function() { | |
var data = "R0lGODlhSABIAOZ/ANtwcLu6uvXY2M/NzdNQUP76Av55Bf2PBeZHBtgtCPz09GwxMf3QBPf3lzgrK/HJye25uY2MjP39X8EBAVIwMPttBoIqK//+/qloaJGMGHJvbeSamuikpL4AAfrr62BeEt+Bgf2tBA8MC8kmJvj0OMYUFcQJCuGJiZtcFujo55kWF5WUY/34+Mw1NswVCPjj4//o2EFBGfzrAkdGRfHx8aYFBSMcHNC8r+52NKs2NcO9LN1NLbaFhMEECPDBwHZ0Pd45Bv78FHpEQcxYAs87OMMHCLE1BOjlAkcFBvfg4P//1Nzb29plDuFbLtEfBvTU0sR7MZAqBL4ZFVIiCvbsG/no59g/IMkMAuyFOHgGBsuJAv//+MUNDaAODulsB//69s0xLv77+/PPz915eeuyssorLKkeHsgQCmg9BrsPDdZcXNhkZOOSksgeHpAhIcQFAqeko+1WCOtyBu19HvRiB/bd3f2BHPvw8DAvENBCQviiJOqsq9zaB7MQDgAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJCgB/ACwAAAAASABIAAAH/4B/goOEhYaFCoMXgw9jAoeQkZKTkYuEDxCGbGMehwp3lKGih2GESW2PhGwAloYPiaOxoQKggmEEHVWEPkSwhmF7rR53F6Wyx39ia74CE0Wpfwp5PpUbixcbBAoAtcijDyPUjBNnmYJkea2HZLoQHWwcXMbeoQotAIU+EyUcg2pjk5JYG9NBDIEJL+iJetDhSSEPBx8IUlBmwyQWIARsyFOlxARzCif5MMFC0B1jJ1rA8mDC4iQOJ8QIYHHQh5iSISPVKVFrg8M/EMgM8jDhhKBihhI9yINzo6Ocki6cWPOAw4g9gli0UmBizSIFIAVh+iOgCCwQBDol7ZZTAcEJE//6GbqgxkSiMCBanXr0wESnVfMKvYI6KAyACWASHtrQASsvYwJw6eLQoQ4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var date = new Date(); | |
var timestamp = Math.round(date.getTime() / 1000); | |
var node_object = { | |
"type": prompt("Enter content type"), | |
"title": prompt("Enter node title"), | |
"body": { | |
"und": [ | |
{"value": prompt("Enter body text"); } | |
] | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
print '<style>'; | |
$style = '' | |
foreach ($css as $c) { | |
// Do some checking of some media query stuff. | |
// ... | |
// Then store the raw CSS. | |
$style .= file_get_contents($c['data']); | |
} | |
//do some regex to remove some stuff, and remove whitespace. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_webform_component_presave(). | |
*/ | |
function mymodule_webform_component_presave(&$component) { | |
// Maybe I should do some more robust checking here, but this is a simple site | |
// and the body description clearly states how to format lines with links. | |
// Also, remember if you have other use cases for the webform, you should | |
// check that this is actually a webform created by above code! | |
if (strpos($component['name'], '(http') > -1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_node_insert(). | |
*/ | |
function mymodule_node_insert($node) { | |
// The node type I am using is called 'order'. | |
if ($node->type == 'order') { | |
// I am using the body field for values. | |
$body = field_get_items('node', $node, 'body'); | |
$comp = explode("\n", $body[0]['value']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (variable_get('environment', '') == 'development') { | |
return; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
print client_cache_styles($css); | |
print client_cache_scripts($scripts); |
NewerOlder