Skip to content

Instantly share code, notes, and snippets.

@Bouke
Bouke / StringDecimalConverter.cs
Last active July 2, 2025 21:48
Serialize decimal to string in Newtonsoft.Json
public class StringDecimalConverter : JsonConverter
{
public override bool CanRead
{
get
{
return false;
}
}
@magnetikonline
magnetikonline / README.md
Last active October 31, 2025 20:11
NSSM - the Non-Sucking Service Manager cheatsheet.
@belsrc
belsrc / gist:672b75d1f89a9a5c192c
Last active April 15, 2023 15:13
Simple Vue.js filters that I usually need
/**
* Changes value to past tense.
* Simple filter does not support irregular verbs such as eat-ate, fly-flew, etc.
* http://jsfiddle.net/bryan_k/0xczme2r/
*
* @param {String} value The value string.
*/
Vue.filter('past-tense', function(value) {
// Slightly follows http://www.oxforddictionaries.com/us/words/verb-tenses-adding-ed-and-ing
var vowels = ['a', 'e', 'i', 'o', 'u'];
@mattes
mattes / check.go
Last active October 13, 2025 14:50
Check if file or directory exists in Golang
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) {
// path/to/whatever does not exist
}
if _, err := os.Stat("/path/to/whatever"); !os.IsNotExist(err) {
// path/to/whatever exists
}
@ismaelhamed
ismaelhamed / BundleConfig.cs
Created July 11, 2014 11:20
Bundling AngularJS Templates with ASP.NET MVC
using System.Web.Optimization;
namespace NgTemplateBundling
{
using NgTemplateBundling.Bundling;
public class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
@demisx
demisx / angularjs-providers-explained.md
Last active August 26, 2025 03:06
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@EdCharbeneau
EdCharbeneau / string.isNullOrWhiteSpace.js
Created March 14, 2014 17:11
Javascript test a string to see if it is Null or Whitespace. Equivelent to C# String.IsNullOrWhiteSpace
function isNullOrWhiteSpace(str) {
return (!str || str.length === 0 || /^\s*$/.test(str))
}
@carolineschnapp
carolineschnapp / gist:9122054
Last active October 25, 2024 16:31
Order form to use in a page or collection template.
{% comment %}
Source: https://gist.github.com/carolineschnapp/9122054
If you are not on a collection page, do define which collection to use in the order form.
Use the following assign statement, replace 'your-collection-handle-here' with your collection handle.
{% assign collection = collections.your-collection-handle-here %}
Use the assign statement outside of this comment block at the top of your template.
{% endcomment %}
{% paginate collection.products by 100 %}
@jaicab
jaicab / responsive-video.css
Last active December 11, 2024 20:06
Pure CSS solution for embed videos with an aspect ratio of 16:9
.video-container {
position: relative;
padding-bottom: 56.25%; /*16:9*/
padding-top: 30px;
height: 0;
overflow: hidden;
}
.video-container iframe,
.video-container object,
@user20161119
user20161119 / findingapirequest.json
Created January 1, 2014 08:31
ebay finding api request json
{
"jsonns.xsi": "http://www.w3.org/2001/XMLSchema-instance",
"jsonns.xs": "http://www.w3.org/2001/XMLSchema",
"jsonns.tns": "http://www.ebay.com/marketplace/search/v1/services",
"tns.findItemsByKeywordsRequest": {
"keywords": "great white shark tooth",
"categoryId": [
"15917"
],
"paginationInput": {