Skip to content

Instantly share code, notes, and snippets.

View nesterenes's full-sized avatar

Neil Shaffer nesterenes

View GitHub Profile
@nesterenes
nesterenes / Stylecop.cs
Created July 17, 2014 16:00
C# Stylecop {style, cop, stylecop}
//Source: http://sethflowers.com/blog/force-stylecop-to-ignore-a-file/
<Compile Include="AViolatingFile.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
// <auto-generated/>
@nesterenes
nesterenes / SQL-If-Case-Concat.sql
Created May 27, 2014 19:43
SQL If/Then, Case, Concat {sql, sql-if, sql-cat, concat, condition}
SELECT
Id
,CASE
WHEN Cat.[Description] like '%100%'
THEN '100'
WHEN Cat.[Description] like '%500%'
THEN '500'
ELSE Cat.[Description]
END AS
'Description'
@nesterenes
nesterenes / jQuery_PostTo_MVC_Controller.js
Created May 22, 2014 20:03
jQuery Post to MVC Controller {jquery, mvc, ajax, postback, post}
$(document).ready(function () {
$("#SampleButton").click(function () {
TestFunction();
});
}); //END (document)
// Function used for testing
function TestFunction() {
@nesterenes
nesterenes / jquery_click.js
Last active August 29, 2015 14:01
jQuery Click Function {jquery, click}
$( "#TestButton" ).click(function() {
alert( "Handler for .click() called." );
});
//<button id="TestButton" type="button">Click Me!</button>
@nesterenes
nesterenes / greek_text.txt
Created May 7, 2014 17:42
Ipsel Anne {greek text ipsel}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut en
@nesterenes
nesterenes / Android_Volley_Notes.java
Created May 7, 2014 17:23
Android Volley Notes {volley android}
//> RandomJokeActivity
controller = ChuckNorrisApiController.getInstance(this);
controller.getRandomJoke(new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject jsonObject) {
try {
txtJoke.setText(jsonObject.getJSONObject("value").getString("joke"));
} catch (JSONException e) {
txtJoke.setText(e.getMessage());
@nesterenes
nesterenes / Android_GSON.java
Created May 7, 2014 17:00
Android GSON {android, array, arraylist, gson, java, json}
// https://sites.google.com/site/gson/gson-user-guide
//For an Array "toJSON"
if (ArticlesArray.size() > 0) {
//parse down to an Array from ArrayList
Article[] tempArray = new Article[ArticlesArray.size()];
tempArray = ArticlesArray.toArray(tempArray);
//Create the JSON String from Array
@nesterenes
nesterenes / jQuery Dropdown Value and Text.js
Created May 7, 2014 14:50
jQuery Dropdown Value and Text
$("#hidItemID").val($('#m1_drp_Item').val());
$("#hidItem").val($('#m1_drp_Item :selected').text());
@nesterenes
nesterenes / Formatted String with Variables.cs
Created May 7, 2014 14:49
Formatted String with Variables {c#, asp.net, string, format}
string MyString = ("{0} {1}", MyThing.FirstName, MyThing.LastName);
@nesterenes
nesterenes / jQuery Modify CSS and Attributes.js
Created May 7, 2014 14:48
jQuery Modify CSS and Attributes {jquery, javascript, css, attributes, attr, modify}
$('#m1_txtSupportNoteInput').css("height", "200px");
$('input:not(#m1_MB_FileUpload1)').css("border", "0px");
$('#sub_nav').css("margin-top", "10px");
$('input:not(#m1_MB_FileUpload1)').attr('readonly', 'true');
$('input[type=checkbox]').attr("disabled", 'true');
$('#request_update').attr('href', $('#request_update').attr('href') + "?ticketnumber=" + $('#m1_lbl_TicketNumber').text());