Skip to content

Instantly share code, notes, and snippets.

@TechNinjaWeb
TechNinjaWeb / jquery.rotate.prototype.js
Created April 26, 2016 06:50
jQuery Rotate Selector Prototype
(function($){
$.fn.animateRotate = function(angle, duration, easing, complete) {
return this.each(function() {
var $elem = $(this);
$({
deg: 0
}).animate({
deg: angle
}, {
@TechNinjaWeb
TechNinjaWeb / app.js
Created April 26, 2016 06:56
Backand Connection Test
var app = angular.module('app', ['backand'])
.controller('appCtrl', function($scope, $http, Backand) {
$scope.message = "Loaded";
$scope.appCtrl = $scope;
var self = this;
self.getUsers = function() {
$http({
method: 'GET',
@TechNinjaWeb
TechNinjaWeb / index.tpl.html
Created April 26, 2016 07:00
ES5 Promises & Error Handling
<div id="output">
</div>
@TechNinjaWeb
TechNinjaWeb / HTMLElements
Created May 12, 2016 00:08
Useful Prototypes
/////////////////////////////////////////////////////////////////////////////
// Is Element In View?
// If object's position cannot be determined, no event will fire.
// Define callback argument as a function or object with in and out params
// as listeners for each event.
/////////////////////////////////////////////////////////////////////////////
HTMLElement.prototype.inView = function(cb){
var err;
// Get Window Atribs
var getViewFrame = function(){ return {w: window.innerWidth, h: window.innerHeight, y: window.scrollY }; };
@TechNinjaWeb
TechNinjaWeb / browserify.shim.js
Last active May 14, 2016 18:08 — forked from jshbrntt/gulpfile.js
Gulp + Watchify + Debowerify + Uglify
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Browserify Shims
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// var paths = require('./paths'); // Require Your Paths.JS file
module.exports = {
angular: {
@TechNinjaWeb
TechNinjaWeb / event-handling.vb
Last active January 22, 2017 05:30
Handling event detection and intent
Private LastActiveControl As Control = Me ' initialize on form creation
Protected Overrides Sub UpdateDefaultButton()
' Just added a IsNot condition to clarity
If (LastActiveControl Is txtNumberOfDrinks) AndAlso
((ActiveControl Is btnClear) OrElse (ActiveControl Is btnExit)) Then
' Only problem is that it tries to validate twice upon tabbing away (only once on click)
ElseIf (LastActiveControl Is txtNumberOfDrinks) AndAlso
((ActiveControl IsNot btnClear) OrElse (ActiveControl IsNot btnExit)) Then
validateForm()
@TechNinjaWeb
TechNinjaWeb / Archers_End_Game_Score_Tracker.cpp
Created January 22, 2017 17:53
Archers End Game Tracker
/******************************************************************************
@filename: Archers_End_Game_Score_Tracker.cpp
@author: TechNinja
@date: January 15, 2017
@description: 3 Archers will compete in 4 rounds/ends. Each end will be
tracked and scored out of 60. The program will display each
archer's average end score and the overall match average.
@credits: http://www.cplusplus.com/forum/articles/9645/
*****************************************************************************/
@TechNinjaWeb
TechNinjaWeb / frmMain.vb
Created January 24, 2017 23:09
Lab1B_Form_Code
Option Strict On
'#######################################################################################################
'Author: TechNinja
'Date: January 23, 2017
'Description: A Point of Sales system created for The Cantina Bar from Star Wars.
' It is designed to allow a user to select a type of drink,
' type of meal, and a set of snacks for purchase and will display totals
' for each category and a sum for all
'
'Credits: https://msdn.microsoft.com/en-us/library/6y3efyhx(v=vs.100).aspx
@TechNinjaWeb
TechNinjaWeb / cleverbot-conversation.txt
Last active January 25, 2017 21:08
cleverbot Q & A
-- Cleverbot Conversation String --
What is artificial intelligence?
I have a belief that you are artificial intelligence.
What makes you believe that I am artificial intelligence?
You were created artificially, and possess some rudimentary intelligence.
var answers = Array.prototype.slice.call(document.querySelectorAll('.e #cards .card.blur .back')).forEach(function(el){
el.offsetParent.onmouseover = function(ev){
el.offsetParent.classList.remove('blur')
el.previousElementSibling.style.display = 'none';
}
el.offsetParent.onmouseout = function(ev){
el.offsetParent.classList.add('blur')
el.previousElementSibling.style.display = 'block';
}