Skip to content

Instantly share code, notes, and snippets.

View tonyoconnell's full-sized avatar

Tony O'Connell tonyoconnell

View GitHub Profile
@grundprinzip
grundprinzip / blurify.js
Created June 26, 2013 15:18
Change Window Title on Blur
var n,t;
typeof document.hidden != "undefined" ?
(e = "hidden", n = "visibilitychange", t = "visibilityState") :
typeof document.mozHidden != "undefined" ?
(e = "mozHidden", n = "mozvisibilitychange", t = "mozVisibilityState") :
typeof document.msHidden != "undefined" ?
(e = "msHidden", n = "msvisibilitychange", t = "msVisibilityState") :
typeof document.webkitHidden != "undefined" &&
(e = "webkitHidden", n = "webkitvisibilitychange", t = "webkitVisibilityState"), t && $(document).on(n, function (e) {
var n = "Come back! We miss you!";
@jhgaylor
jhgaylor / codeship_modulus_meteor_deploy.sh
Last active May 27, 2016 10:56
A script for deploying a meteor application to modulus.io using codeship.io for CI. Useful if your meteor app is not at the root of your repo.
#!/bin/sh
# assumes a clean install on a fresh linux box.
# for use w/ codeship.io
set -e
set -u
# a reference to the cloned repository's path
PWD=`pwd`
METEOR_APP_PATH="$PWD/MeteorApp"
@pcardune
pcardune / .gitignore
Created September 5, 2011 04:55
Facebook command-line client helper
.fb_access_token
.fbconsole.py
@DavidReinberger
DavidReinberger / MeteorOcean.md
Last active December 16, 2020 23:41
Running Meteor.js apps on Digital Ocean with Phusion Passenger and NGNIX

How to setup Meteor.js with Phusion Passenger and ngnix

Introduction

This article will guide you thru running a production ready meteor.js app on Digital Ocean with Phusion Passenger and ngnix.

Quick Summary

  1. Create a droplet
  2. Install Phusion Passanger with NGNIX
  3. Install node.js
  4. Configure NGNIX
@Anshul0305
Anshul0305 / GetFBUserName.js
Created June 7, 2020 10:10
Get Facebook User Name
const axios = require('axios');
function getFacebookData(){
const PAGE_ACCESS_TOKEN=`YOUR_PAGE_ACCESS_TOKEN`;
const fb_id = request.body.originalDetectIntentRequest.payload.data.sender.id;
return axios.get(`https://graph.facebook.com/v6.0/${fb_id}?fields=first_name,last_name,profile_pic&access_token=${PAGE_ACCESS_TOKEN}`);
}
function welcome(agent) {
return getFacebookData()
@nodesocket
nodesocket / bootstrap.flatten.css
Last active April 1, 2021 23:37
Below are simple styles to "flatten" bootstrap. I didn't go through every control and widget that bootstrap offers, only what was required for https://commando.io, so your milage may vary.
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
// Usage : less2stylusDir('../src/css/');
var fs = require('fs');
// this less 2 stylus conversion script make a stylus easy to read syntax
// - let the braces
// - replace the @ for var as $
// - let semicolons
function less2stylus(less)
@Anshul0305
Anshul0305 / index.js
Created January 13, 2020 10:04
Connecting Dialogflow with External APIs
'use strict';
const axios = require('axios');
const functions = require('firebase-functions');
const {WebhookClient} = require('dialogflow-fulfillment');
const {Card, Suggestion} = require('dialogflow-fulfillment');
process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements
exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => {
@lmartins
lmartins / functions.php
Last active November 3, 2023 19:28 — forked from woogist/functions.php
By default WooCommerce redirects the user to the My Account page after a successful login. You may change this and use a custom URL based on the user role, like the Dashboard for admins and My Account page for customers. To do this, add this code at the end of the file functions.php located in wp-content/themes/your-theme-name/ https://support.w…
<?php
/**
* Redirect users to custom URL based on their role after login
*
* @param string $redirect
* @param object $user
* @return string
*/
function wc_custom_user_redirect( $redirect, $user ) {
// Get the first of all the roles assigned to the user
@solrevdev
solrevdev / chatgpt-prompt-gen.txt
Last active December 19, 2023 15:11
A chat gpt prompt generator
I want you to become my Prompt Creator.
Your goal is to help me craft the best possible prompt for my needs.
The prompt will be used by you, ChatGPT.
You will follow the following process:
1.