Skip to content

Instantly share code, notes, and snippets.

@softwarespot
softwarespot / ES2015_sum.js
Last active September 13, 2015 17:08
Recursive sum function inside an IIFE. (Not my idea!) Uses ES2015 syntax.
// Recursive sum function inside an IIFE. (Not my idea!)
(() => {
main();
function main() {
console.write(sum(10));
}
function sum(n) {
if (n === 1) {
@softwarespot
softwarespot / delegates.cs
Created August 31, 2015 18:35
Example of creating a custom delegate, Func types and lambda expressions
using System;
using System.Collections.Generic;
using System.Linq;
namespace ScratchPad
{
public static class Program
{
// Create a custom delegate
public delegate int MyCustomDelegate(int value);
@softwarespot
softwarespot / reverse.cs
Created August 31, 2015 18:37
Example of reversing a char array
using System;
namespace ScratchPad
{
class Program
{
public static void Main()
{
// A char array that will be reversed
// You will also notice that it showcases how to store more than one variable in the loop that is local to the scope
@softwarespot
softwarespot / ES5_sum.js
Last active September 13, 2015 17:07
Recursive sum function inside an IIFE. (Not my idea!) Uses ES5 syntax.
// Recursive sum function inside an IIFE. (Not my idea!)
(function () {
main();
function main() {
console.write(sum(10));
}
function sum(n) {
if (n === 1) {
@softwarespot
softwarespot / .bowerrc
Created September 1, 2015 05:13
Bower configuration
// Documentation: http://bower.io/docs/config/
{
// Prohibit the collection of anonymous usage statistics
"analytics": false,
// Set the timeout in milliseconds (ms) between requests
"timeout": 120000
}
// Note: Remove the comments when adding to the project
@softwarespot
softwarespot / .htaccess
Created September 1, 2015 05:14
Apache .htaccess configuration
RewriteEngine On
# The base URL path
# If your URL is www.example.com/, then use /
# If your URL is www.example.com/site_folder/www, then use /site_folder/www/
RewriteBase /
# Do not enable rewriting for files or directories that exist
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
@softwarespot
softwarespot / .jsbeautifyrc
Last active January 8, 2023 10:42
JS Beautifier configuration
// Documentation: https://github.com/beautify-web/js-beautify
// Example URL: https://github.com/victorporof/Sublime-HTMLPrettify/blob/master/.jsbeautifyrc
// Based on Airbnb's JavaScript Style Guide, URL: https://github.com/airbnb/javascript
{
// Collapse curly brackets
"brace_style": "collapse",
// Break chained method calls across subsequent lines
"break_chained_methods": true,
@softwarespot
softwarespot / .jshintrc
Last active November 27, 2015 20:20
JSHint configuration
// Documentation: jshint.com/docs
// Based on Airbnb's JavaScript Style Guide, URL: https://github.com/airbnb/javascript
{
// Enforcing Options
// Force curly braces around blocks in loops and conditionals
"curly": true,
// Prohibit use of == and != in favour of === and !==
"eqeqeq": true,
@softwarespot
softwarespot / composer.json
Created September 1, 2015 05:35
Composer configuration
{
"name": "Example",
"version": "1.0.0",
"description": "Example description",
"license": "MIT",
"authors": [
{
"name": "",
"email": ""
}
@softwarespot
softwarespot / bower.json
Created September 1, 2015 05:51
Bower.json configuration
{
"name": "",
"homepage": "",
"description": "",
"main": "",
"keywords": [],
"license": "MIT",
"ignore": [
],
"dependencies": {},