Skip to content

Instantly share code, notes, and snippets.

Dinesh Copoosamy dineshcooper

View GitHub Profile
@dineshcooper
dineshcooper / .jshintrc
Last active Jun 8, 2018
My jshint config for angular apps
View .jshintrc
{
"curly":true,
"devel":true,
"eqeqeq": true,
"globals":{
"angular": true
},
"indent":2,
"quotmark": "single",
"strict": true,
@dineshcooper
dineshcooper / gist:5789630
Created Jun 15, 2013
Have your drupal module's custom tables schema automatically updated - useful if you developing and making changes to the table. You will need to change the strpos line to look for whatever naming convention you used for your module's tables. (p.s. don't know if this is bad form in any way - but fuck it saves a lot of time)
View gist:5789630
function MYMODULENAME_schema(){
$schema = array();
$inspect = schema_dbobject()->inspect();
foreach ($inspect as $key => $value) {
if (strpos($key,'MYMODULENAME_') !== false) {
$schema[$key] = $value;
}
}
@dineshcooper
dineshcooper / gist:5340284
Created Apr 8, 2013
passing along a cookie with restler - NB: Cookie key in headers must not be quoted
View gist:5340284
var cookie = key + '=' + val;
rest.post('http://example.com/api/call_that_needs_auth',{
data: {
some_param:paramval
},
headers: {
'Host': 'example.com',
Cookie : cookie
}
}).on('complete',function(data){
@dineshcooper
dineshcooper / canvas.css
Created Mar 20, 2012
Dynamically load canvas app specific JS and CSS if page is being viewed within Facebook Canvas
View canvas.css
/* Put any canvas specific css here - i just put a border around the canvas to test that it's working */
body{
border: 2px solid #666;
}
@dineshcooper
dineshcooper / responsive_likebox.html
Created Mar 19, 2012
Responsive Facebook Like Box
View responsive_likebox.html
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>
</head>
<body>
<div id="container" style="width:100%;">
<div class="fb-like-box" data-href="https://www.facebook.com/adobegocreate" data-width="292" data-show-faces="true" data-stream="true" data-header="true"></div>
</div>
You can’t perform that action at this time.