Skip to content

Instantly share code, notes, and snippets.

View cloaked-ninja's full-sized avatar

btcNinja cloaked-ninja

  • working on it ;)
  • nexus
View GitHub Profile
<?php
/*
-- the SQL database table
create table form_ajax (
ID varchar(5) not null,
Name varchar(100),
Address varchar(100),
Phone varchar(20),
Email varchar(255),
UrlExists(sitename2, function(status) {
if (status === 200) {
// file was found
console.log('URL found successfully');
} else if (status === 404) {
// 404 not found
console.log('not this tyme - ' + output);
//runs code to change the output (combined site name/variable)
//make this a while loop - checking that the site name doesn't work
for (var i = 0; i < 11; i++) {
@cloaked-ninja
cloaked-ninja / changeLink.js
Created August 16, 2016 12:22
Change link dynamically
var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
// Opera 8.0+ (UA detection to detect Blink/v8-powered Opera)
var isFirefox = typeof InstallTrigger !== 'undefined'; // Firefox 1.0+
var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
// At least Safari 3+: "[object HTMLElementConstructor]"
var isChrome = !!window.chrome && !isOpera; // Chrome 1+
var isIE = /*@cc_on!@*/false || !!document.documentMode; // At least IE6
var output = 'Detecting browsers by ducktyping:<hr>';
output += 'isFirefox: ' + isFirefox + '<br>';
@cloaked-ninja
cloaked-ninja / sharePointStartup.ps1
Created October 6, 2016 15:29
Profile for SharePoint Powershell
#Test for existence using the Test-Path cmdlet
#Set up initial profile script for SharePoint in other programs
#Run this in any PowerShell window to create a new profile
if (!(Test-Path $profile.AllUsersAllHosts)) {
New-Item -Type File -Path $profile.ALlUsersAllHosts -Force}
powershell_ise $profile.AllUsersAllHosts
@cloaked-ninja
cloaked-ninja / download.ps1
Created October 13, 2016 22:30
download files from sharepoint
$destination = "C:\users\userName\desktop\testFolder"
$webUrl = "http://sharetest"
$listUrl = "http://sharetest/office"
##############################################################
$web = Get-SPWeb -Identity $webUrl
$list = $web.GetList($listUrl)
function ProcessFolder {
@cloaked-ninja
cloaked-ninja / js-stop-edit.js
Created October 28, 2016 14:39
javascript stopfield edit
1. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"    
2.        type="text/javascript"></script>    
3.      
4. <script type="text/javascript">    
5.      
6. $(document).ready(function()    
7. {    
8. //Set the Field to Read only and change its background colour    
9. $("input[title='FieldName']").attr("readonly","true").css('background-color','#F6F6F6');    
10.     
@cloaked-ninja
cloaked-ninja / README.md
Created January 30, 2017 14:21 — forked from ajur/README.md
D3.js exaple template

Basic template for D3 example. Ready for usage with bl.ocks.org.

@cloaked-ninja
cloaked-ninja / ipak.R
Created February 2, 2017 22:50 — forked from stevenworthington/ipak.R
Install and load multiple R packages at once
# ipak function: install and load multiple R packages.
# check to see if packages are installed. Install them if they are not, then load them into the R session.
ipak <- function(pkg){
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
if (length(new.pkg))
install.packages(new.pkg, dependencies = TRUE)
sapply(pkg, require, character.only = TRUE)
}
@cloaked-ninja
cloaked-ninja / VFRemoteObject.html
Created February 7, 2017 22:18 — forked from karanrajs/VFRemoteObject.html
A Visualforce page to demonstrate the functionality of Visualforce Remote Objects
<!---
@author : Karanraj
@Description : A Visualforce page to demonstrate the functionality of Remote Objects
-->
<apex:page showHeader="false" standardStylesheets="false">
<!-- Boostrap and jQuery file -->
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css" />