Skip to content

Instantly share code, notes, and snippets.

View betoflakes's full-sized avatar
🐛
Debugging

JR Saucedo betoflakes

🐛
Debugging
View GitHub Profile
@strangerstudios
strangerstudios / gist:2232405
Created March 29, 2012 01:56
Pay Per Post for WordPress with Paid Memberships Pro
<?php
/*
Limiting posts per user.
Enable the Paid Memberships Pro plugin and then add this code to your functions.php or as a stand alone plugin.
Be sure to read through this code carefully. Update each function to suit your needs.
This code has not been tested. Feel free to post issues in the comments.
*/
//increment post limit when checking out
function my_pmpro_after_checkout($user_id)
{
@aymanfarhat
aymanfarhat / urlobject.js
Last active July 27, 2017 00:04
JS utility function that: - Breaks down url to an object with accessible properties: protocol, parameters object, host, hash, etc... - Converts url parameters to key/value pairs - Convert parameter numeric values to their base types instead of strings - Store multiple values of a parameter in an array - Unescape parameter values
function urlObject(options) {
"use strict";
/*global window, document*/
var url_search_arr,
option_key,
i,
urlObj,
get_param,
key,
@mdunisch
mdunisch / How you get Sail.js running on Openshift.md
Last active July 13, 2023 14:51
Get Sails.js running on Openshift

#How you get Sail.js running on Openshift#

This instruction is tested with:

  • Sails.js v0.9.16
  • Node.js 0.10 on Openshift ( 05 May 2014)

###1) package.json

If you use the package.json build by sails new Projectname than you have to add a few fields for openshift – so the server can start you app automatically. Sails uses Grunt to build minify css/js and so on. Openshift dont have grunt installed so you have to add this also.

@ngpestelos
ngpestelos / remove-docker-containers.md
Last active May 31, 2024 15:10
How to remove unused Docker containers and images

May 8, 2018

I wrote this four years ago, so instead use this command:

$ docker rmi $(docker images -q -f dangling=true)
@parhelium
parhelium / post-commit-version
Last active August 21, 2020 13:43
post commit git hook - grabs commit, branch and timestamp
#!/usr/bin/env node
var exec = require('child_process').exec,
Promise = require('promise'),
path = require('path'),
moment = require('moment'),
util = require('util'),
fs = require('fs'),
contents = null,
branch, commit;
@laracasts
laracasts / gist:f4a304232c1be6dbb4f8
Last active February 16, 2023 20:19
Laracasts PHPStorm theme.

The Laracasts PHPStorm theme - modified.

This is a slightly modified version of the great Laracasts PHPStorm theme. I've added some styles for Verions Control (add, modified, deleted line...) and fixed some missing things like warnings.

Download

image

Mac: Add to ~/Library/Preferences/WebIde80/colors

@jrschumacher
jrschumacher / build-and-deploy.sh
Last active April 23, 2019 17:38
Ionic Automated Build and Deploy to HockeyApp
#!/bin/bash
PROJECT_NAME=MyApp
SCHEME_NAME=MyApp
STARTTIME=$(date +%s);
set -e
set -x
### Install dependencies
echo "--- Install dependencies [Time Elapsed $(($(date +%s) - $STARTTIME))s]"
#!/usr/bin/python
# Import the required modules
import cv2, os
import numpy as np
from PIL import Image
import time
# For face detection we will use the Haar Cascade provided by OpenCV.
cascadePath = "haarcascade_frontalface_default.xml"
faceCascade = cv2.CascadeClassifier(cascadePath)
@betoflakes
betoflakes / cloudSettings
Last active August 10, 2021 02:52
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-08-10T02:52:14.252Z","extensionVersion":"v3.4.3"}