Skip to content

Instantly share code, notes, and snippets.

View iamsingularity's full-sized avatar
🏠
Working from home

Shashi Kumar Nagulakonda iamsingularity

🏠
Working from home
View GitHub Profile
@iamsingularity
iamsingularity / JsonFormatter.cs
Last active February 15, 2017 23:36 — forked from mauricedb/gist:5356933
Return JSON data in a camelCase format from an ASP.NET WebAPI controller.
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
using System;
using Microsoft.Owin;
using NLog; // Using NLog in this example
namespace com.github.gist.coenm
{
public static class LogRequestResponseHelper
{
public static void LogDebugResponse(Logger logger, IOwinResponse response)
{
@iamsingularity
iamsingularity / 0_reuse_code.js
Created February 15, 2017 22:40
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
@iamsingularity
iamsingularity / JObjectExtensions.cs
Created February 17, 2017 04:01 — forked from BryanWilhite/JObjectExtensions.cs
JSON.NET: JObject extension methods
/// <summary>
/// Extensions of <see cref="JObject"/>
/// </summary>
public static class JObjectExtensions
{
/// <summary>
/// Gets the <see cref="JArray"/>.
/// </summary>
/// <param name="jsonObject">The json object.</param>
/// <param name="arrayPropertyName">Name of the array property.</param>
@iamsingularity
iamsingularity / install-vsix-appveyor.ps1
Last active April 4, 2018 15:01 — forked from FeodorFitsner/install-vsix-appveyor.ps1
Installing a VSIX extension from command line
$vsixPath = "$($env:USERPROFILE)\sqlite-wp81-winrt-3081002.vsix"
(New-Object Net.WebClient).DownloadFile('https://visualstudiogallery.msdn.microsoft.com/5d97faf6-39e3-4048-a0bc-adde2af75d1b/file/132406/15/sqlite-wp81-winrt-3081002.vsix', $vsixPath)
"`"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\VSIXInstaller.exe`" /q /a $vsixPath" | out-file ".\install-vsix.cmd" -Encoding ASCII
& .\install-vsix.cmd
@iamsingularity
iamsingularity / index.json
Created April 6, 2018 01:19 — forked from jhnns/index.json
JavaScript library types.
[
{
"name": "web-framework",
"description": "Transforms a given application state into an HTML or DOM representation. Additionally, it is also often concerned with request routing, data fetching and persistence, change propagation, input validation, user session management and build optimizations."
},
{
"name": "testing-framework",
"description": "Provides a CLI and an API to run software tests and report results."
},
{
@iamsingularity
iamsingularity / index.json
Created April 7, 2018 01:40 — forked from jhnns/index.json
Most popular web repositories with at least 10.000 stars. Compiled in May 2017 with https://github.com/jhnns/popular-javascript-projects. The list of repo types can be found at https://gist.github.com/jhnns/d233e88b40f5a2993c240847ccef4ee3.
[
{
"name": "freeCodeCamp/freeCodeCamp",
"description": "The https://freeCodeCamp.com open source codebase and curriculum. Learn to code and help nonprofits.",
"stars": 266038,
"type": "other"
},
{
"name": "twbs/bootstrap",
"description": "The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.",
// respond to a Bootstrap carousel "slid" event
$('#my-carousel').on('slid', '.carousel', function() {
// first, since we're outside AngularJS, we need to grab
// the AngularJS scope that this element resides in
var scope = angular.element(this).scope();
// next, we find the active item in the carousel, and grab
// some data-* from it
var active = $(this).find('.active');
var description = active.attr('data-description');
@iamsingularity
iamsingularity / Unbundler.cs
Created May 23, 2018 19:45
Unbundling scripts for debugging
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Newtonsoft.Json;
using System.IO;
using System.Text;
namespace MyApplication
var someCoolModule = (function() {
var privateVariable = 12345;
return { doSomething: function() { alert( privateVariable );
}, doSomethingElse: function() {
// ...
}
}