Skip to content

Instantly share code, notes, and snippets.

View hiddentao's full-sized avatar
🌱

Ramesh Nair hiddentao

🌱
View GitHub Profile
@hiddentao
hiddentao / gist:0c9137e72493e3be26ce
Last active August 29, 2015 14:22
Gulp + Browserify + Watchify for building JS code
browserify = require 'browserify'
source = require 'vinyl-source-stream2'
uglify = require 'gulp-uglify'
watchify = require 'watchify'
gulp = require 'gulp'
gutil = require 'gulp-util'
gulp.task 'js', ->
_process = (b) ->
@hiddentao
hiddentao / setupHipChat.js
Last active August 29, 2015 14:07
Setting up a HipChat room notifier in a Waigo startup step
"use strict";
var HipChatter = require('hipchatter'),
Q = require('bluebird');
var _ = require('waigo')._;
module.exports = function*(app) {
if (app.config.hipChat) {
@hiddentao
hiddentao / patch.diff
Last active August 29, 2015 14:04
Fix Soundcloud is Gold Wordpress plugin (v2.2.2) to work when using Wordpress with HTTPS
diff --git a/wp-content/plugins/soundcloud-is-gold/soundcloud-is-gold-functions.php b/wp-content/plugins/soundcloud-is-gold/soundcloud-is-gold-functions.php
index e2eefe3..48f01b0 100644
--- a/wp-content/plugins/soundcloud-is-gold/soundcloud-is-gold-functions.php
+++ b/wp-content/plugins/soundcloud-is-gold/soundcloud-is-gold-functions.php
@@ -610,18 +610,20 @@ function soundcloud_is_gold_player($id, $user, $autoPlay, $comments, $width, $cl
$player = '<div class="soundcloudIsGold '.esc_attr($classes).'" id="soundcloud-'.esc_attr($id).'">';
+ $httpPrefix = (is_ssl() ? 'https' : 'http');
+
@hiddentao
hiddentao / jenkins_nginx_ssl_ubuntu.sh
Last active January 4, 2016 08:09
Setting up Nginx SSL-PFS + Jenkins on Ubuntu 12.04
# Install Jenkins
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
ACTION: check that Jenkins is running on yourdomain.com:8080
# SSL certificates with Perfect Forward Secrecy
# (assuming /etc/ssl/certs/yourdomain.com.pem already exists)
@hiddentao
hiddentao / gist:7300694
Last active January 22, 2019 05:04
An improvement on the angular.module() API, making it easier to split up modules into multiple files without having to worry about only registering them once.
/**
* Workaround to make defining and retrieving angular modules easier and more intuitive.
*/
(function(angular) {
var origMethod = angular.module;
var alreadyRegistered = {};
/**
@hiddentao
hiddentao / gist:5946053
Last active November 13, 2018 18:18
Generate overridable getters and setters in Javascript
// see blog post: http://www.hiddentao.com/archives/2013/07/08/generate-overridable-getters-and-setters-in-javascript/
Function.prototype.generateProperty = function(name, options) {
// internal member variable name
var privateName = '__' + name;
options = options || {};
options.get = ('undefined' === typeof options.get ? true : options.get );
options.set = ('undefined' === typeof options.set ? true : options.set );
// pre-initialise the internal variable?