Skip to content

Instantly share code, notes, and snippets.

View modemlooper's full-sized avatar
🏠
Working from home

modemlooper modemlooper

🏠
Working from home
View GitHub Profile
@modemlooper
modemlooper / unblock.js
Last active April 17, 2018 22:44
unblock all twitter followers
/* eslint-disable camelcase, comma-dangle */
const Twit = require('twit');
const Future = require('fluture');
const { Either, Reader } = require('ramda-fantasy');
const logError = x => console.error(x); // eslint-disable-line no-console
const log = x => console.log(x); // eslint-disable-line no-console
// getBlocks :: TwitterClient -> Future
// get all of your blocks
@modemlooper
modemlooper / htaccess.txt
Created April 16, 2018 23:01
htaccess for stencil apps so they load dynamic urls
#Remove .html from urls
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]
# Is it a file? serve it, is it not a file? serve index.html
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.html [L]
@modemlooper
modemlooper / letsencrypt.md
Created March 30, 2018 02:32
Installing Let's Encrypt with Cerbot on DigitalOcean & ServerPilot

Let's Encrypt

SSH as root into the server

ssh root@SERVER_IP_ADDRESS

Install Certbot

wget https://dl.eff.org/certbot-auto
@modemlooper
modemlooper / fix.css
Created January 5, 2018 17:18
ionic header padding fix slide from modal
.toolbar-ios {
height: 44px + $cordova-ios-statusbar-padding;
padding-top: $cordova-ios-statusbar-padding;
}
.toolbar-title-ios {
padding-top: $cordova-ios-statusbar-padding;
}
@modemlooper
modemlooper / block-activity-types.php
Last active December 14, 2017 17:19
block bp activity types from saving to db
function wp43566_activity_dont_save( $activity_object ) {
$exclude = array(
'joined_group',
'activity_update',
'new_member',
'created_group',
'updated_profile',
'new_avatar',
'new_event',
'friendship_accepted',
@modemlooper
modemlooper / reset-cookie.php
Created September 27, 2017 17:14
reset activity filter cookie on page load
@modemlooper
modemlooper / moderate-filter.php
Created September 14, 2017 00:57
add moderate filter to groups loop
/**
* Adds moderater filter to groups loop
*
* @return void
*/
function otc_group_moderate_option_filter() {
?>
<option value="moderate"><?php _e( 'Moderate' ); ?></option>
<?php
}
@modemlooper
modemlooper / test_activity.php
Created August 17, 2017 18:22
Add Test Activity
function bp_add_test_activity() {
for ( $k = 0 ; $k < 10; $k++ ) {
$args = array(
'action' => 'test',
'content' => 'This is a test activity',
'component' => 'activity',
'type' => 'activity_update',
);
bp_activity_add( $args );
@modemlooper
modemlooper / taskbot-example.php
Last active August 5, 2017 01:00
TaskBot Example Class
<?php
/**
* Taskbot_Example.
*
* @author modemlooper
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
<?php
/* --- Exit if accessed directly --- */
if ( !defined( 'ABSPATH' ) ) exit;
/* --- Check if member is a friend --- */
function bp_displayed_user_is_friend() {
global $bp;
if ( bp_is_active('friends') ) {