Skip to content

Instantly share code, notes, and snippets.

Working from home

Chris Fidao fideloper

Working from home
Block or report user

Report or block fideloper

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View http_request.json
"_index": "http-access-2015.08.28",
"_type": "fluentd",
"_id": "AU91sX8H3fvMhMs_8892",
"_score": null,
"_source": {
"remote": "",
"host": "-",
"user": "-",
"method": "\\x16\\x03\\x01\\x010\\x01\\x00\\x01,\\x03\\x03\\x18\\x1B\\x85\\xAA\\x81\\xA7\\x91\\x1F\\xDA\\xCA1rg+\\xB0\\x1F\\x94\\xF3\\xE9\\x03\\xB5\\x80$g*\\x18\\xEFeAv\\xDES\\x00\\x00\\x96\\xC00\\xC0,\\xC0(\\xC0$\\xC0\\x14\\xC0",
View hsapi_example.php
$hsapi = new HelpSpotAPI(array(
'helpSpotApiURL' => 'http://.../api/index.php', // Your credentials as normal
'username' => '',
'password' => 'pass'
// Your normal activites here to bulid the $helpspot_request array
View example.sql
sql_query = SELECT topic_id, topic FROM topics
# joined/payload field fetch query
# joined fields let you avoid (slow) JOIN and GROUP_CONCAT
# payload fields let you attach custom per-keyword values (eg. for ranking)
sql_joined_field = post from query; \
SELECT topic_id, post \
FROM posts \
ORDER BY topic_id ASC
fideloper / stupid_sample.rb
Created Jun 8, 2015
just a printed string
View stupid_sample.rb
print "This is whatever"
fideloper /
Created Oct 20, 2011
bash shell file for daily database backup - Run as CRON job
/usr/bin/mysqldump --user=DB_USER --password='DB_PASSWORD' --databases DB_NAME | gzip > /path/to/backup/DB_NAME-`date +%Y%m%d%H%M`.sql.gz
find /path/to/backup -name "*.gz" -mtime +60 -exec /bin/rm {} \;
fideloper /
Created Oct 20, 2011
Shell script to check log files in real time via ssh
ssh -l "$remoteuser" "$remotecomputer" "tail -f path/to/log/files/log-`date +"%Y-%m-%d"`.php"
fideloper / youtube.public.feed.js
Created Oct 20, 2011
Youtube public channel uploaded videos
View youtube.public.feed.js
//See more
//url:'', //also usable, but less awesome
data:{author:'USERNAME', v:2, orderby:'published', alt:'json', 'max-results':10},
success:function(data, textStatus, XMLHttpRequest) {
fideloper / jquery.plugin.template.js
Created Oct 20, 2011
jQuery plugin template - legit
View jquery.plugin.template.js
var environment = {};
var methods = {
init:function(options) {
var options = $.extend({}, options);
return this.each(function() {
fideloper / zend.bootstrap.php
Created Oct 20, 2011
Sample Zend boot strap file - layout, views, registry, error handling
View zend.bootstrap.php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
protected function _initLayoutHelper()
$layout = Zend_Controller_Action_HelperBroker::addHelper(
new AppName_Controller_Action_Helper_LayoutLoader());
fideloper / twitter.public.timeline.js
Created Oct 20, 2011
Get public Twitter timeline with jQuery ajax - with retweets
View twitter.public.timeline.js
data:{screen_name:'USERNAME', include_rts:1}, //show retweets
success:function(data, textStatus, XMLHttpRequest) {
var tmp = false;
var results = $('#twitter_results');
for(i in data) {
You can’t perform that action at this time.