This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string getUrl = "http://whatevatreva.kwom"; | |
string postData = String.Format("organization_id={0}&subscriber_firstname={1}", "313", "Treva"); | |
HttpWebRequest getRequest = (HttpWebRequest)WebRequest.Create(getUrl); | |
getRequest.Method = WebRequestMethods.Http.Post; | |
getRequest.ContentType = "application/x-www-form-urlencoded"; | |
byte[] byteArray = Encoding.ASCII.GetBytes(postData); | |
getRequest.ContentLength = byteArray.Length; | |
Stream newStream = getRequest.GetRequestStream(); | |
newStream.Write(byteArray, 0, byteArray.Length); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(E: && cd E:\inetpub\wwwroot\thissite.staging.com && git.exe pull) | |
(cd E:\inetpub\wwwroot\thatsite.staging.com && git.exe pull) | |
(cd E:\inetpub\wwwroot\anothersite.staging.com && git.exe pull) | |
REM: to run this from a scheduled task with output appended to a text file enter this in the task action /C E:\GCGitOps\gitPulls.bat >> E:\GCGitOps\gitPulls.output.txt 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var frames = []; // fill array with stuff | |
var frame = 0; // a frame index | |
// when its time to increment frame array this will start from firs pos in array to last pos then restart from first pos | |
// more than likley to be called from a function within setInterval | |
frame = (frame + 1) % frames.length; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IEnumerable<ScoreReport> GetWeeklyLeaderBoardTotals(Guid challengeId, ChallengeType challengeType) | |
{ | |
xxxFBAppEntities context = new xxxFBAppEntities(); | |
context.Configuration.ProxyCreationEnabled = false; | |
var scoreData = from score in context.Scores | |
.Include("User") | |
.Include("Challenge") | |
where score.Active == (int)ActiveType.Active && | |
score.ChallengeID == challengeId && |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Data; | |
using System.Data.Sql; | |
using System.Data.SqlClient; | |
using System.IO; | |
namespace dbDump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String GetRemoteHTTPContent(string remoteFile) | |
{ | |
string responseFromServer = string.Empty; | |
try | |
{ | |
WebRequest request = WebRequest.Create(remoteFile); | |
request.Credentials = CredentialCache.DefaultCredentials; | |
WebResponse response = request.GetResponse(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private string GetRandomImage(string url) | |
{ | |
SPList list = SPContext.Current.Web.GetList(url); | |
SPView view = SPContext.Current.Web.GetViewFromUrl(url); | |
SPListItemCollection curItems = list.GetItems(view); | |
Random random = new Random(); | |
int index = random.Next(0, curItems.Count); | |
return curItems[index]["RequiredField"].ToString(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PS> asnp Microsoft.SharePoint.PowerShell | |
PS> $web = get-spweb http://server/site | |
PS> $web.WebTemplate | |
PS> $web.WebTemplateId |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function async(params) | |
{ | |
/// <summary>async - jQuery $.ajax wrapper</summary> | |
/// <param name="params" type="object">Params to build the XHR request</param> | |
var data = params.data || ''; | |
var type = params.type || 'GET'; | |
var cache = params.cache || true; | |
var contentType = params.contentType || 'application/x-www-form-urlencoded; charset=UTF-8'; | |
var dataType = params.dataType || 'json'; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var context = new window.webkitAudioContext(), | |
osc = context.createOscillator(), | |
osc2 = context.createOscillator(), | |
gain = context.createGain(), | |
w = window.innerWidth, | |
h = window.innerHeight; | |
osc.frequency = 400; | |
osc.connect(context.destination); |