Skip to content

Instantly share code, notes, and snippets.

View issunboshi's full-sized avatar

Cliff Williams issunboshi

View GitHub Profile

Keybase proof

I hereby claim:

  • I am issunboshi on github.
  • I am issunboshi (https://keybase.io/issunboshi) on keybase.
  • I have a public key ASCVrMJfgYEGAKK1oD6NbeyC_EhSsVAD_uV_bKjKEnVH0Qo

To claim this, I am signing this object:

@issunboshi
issunboshi / 0_reuse_code.js
Created December 14, 2015 14:35
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
{
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch"
],
@issunboshi
issunboshi / parallax.js
Created April 30, 2015 07:33
Parallax library without jQuery dependency and using ES6 modules
import {indexOf} from 'helpers/indexOf';
import {addClass} from 'helpers/addClass';
import {removeClass} from 'helpers/removeClass';
var parallax = function() {
// @todo change to Class and establish these vars in constructor. Will enable Class to be generic
/* Globals
-------------------------------------------------- */
var PROPERTIES = ['translateX', 'translateY', 'opacity', 'rotate', 'scale'],
@issunboshi
issunboshi / app.css
Created February 7, 2014 10:29
Base form Sass
@import "compass/css3/transition";
*, *:before, *:after {
box-sizing: border-box;
box-sizing: -moz-border-box;
box-sizing: -webkit-border-box;
}
// General
$label_width: 125px;
@issunboshi
issunboshi / Twitter feed
Created August 13, 2013 16:36
A Twitter feed snippet that separates out links included amongst text and wraps them in a tags
<?php
@require_once('twitteroauth/twitteroauth.php');
$twitteruser = "@ssetelecoms";
$notweets = 3;
$consumerkey = "kJ1XGV8QkbR411MKrWV6Q";
$consumersecret = "HgRC8zL2dzX0m8HFfr4EdOwe4fmmwWm4Anp3UaJx0";
$accesstoken = "95167909-qSMJwB7cC2Qc0oiS60ruOjgp9iSolklD21F7hTaSp";
$oauth_token_secret = "GoowY6AWcOtCUzyirsZQapvp8FYTnCVE21nNr7v0M";
function getConnectionWithAccessToken($cons_key, $cons_secret, $oauth_token, $auth_token_secret) {
$connection = new TwitterOAuth($cons_key, $cons_secret, $oauth_token, $auth_token_secret);
@issunboshi
issunboshi / WP Functions
Created July 5, 2013 08:29
Standard snippets I add to most WP projects -security, usability, cleaner code etc.
//Remove specific login errors to prevent hackers knowing that they got either the password or username correct. Renable if users are facing issues.
add_filter('login_errors',create_function('$a', "return null;"));
//Remove multiple jQuery script tags and import one using the specified version
if( !is_admin()){
wp_deregister_script('jquery');
wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"), false, '1.9.1');
wp_enqueue_script('jquery');
}
@issunboshi
issunboshi / Standard WP-Config setup
Last active December 19, 2015 09:29
The two snippets I add to almost every WP project I work on.
// set environment based on server name
switch($_SERVER['SERVER_NAME']){
case "issunboshi.test.com":
define('base_path', './');
define('env_debug', true); //Define error message setting based on environment
define('environment', 'issunboshi'); //Define name of each environment
break;
case "another_user.test.com":
define('base_path', './');