Skip to content

Instantly share code, notes, and snippets.

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

DarkRoku12 DarkRoku12

🏠
Working from home
  • Dominican Republic
View GitHub Profile
@amokan
amokan / RequestTimingFilter.cs
Created July 15, 2011 19:37
example of IResultFilter and IActionFilter
using System.Diagnostics;
using System.Web.Mvc;
namespace YourApp.Web.Infrastructure.Filters
{
/// <summary>
/// Filter to display the execution time of both the action and result
/// </summary>
public class RequestTimingFilter : IActionFilter, IResultFilter
{
@Goles
Goles / CountryCodes.json
Created July 29, 2012 05:37
Country and Dial or Phone codes in JSON format
[{"name":"Israel","dial_code":"+972","code":"IL"},{"name":"Afghanistan","dial_code":"+93","code":"AF"},{"name":"Albania","dial_code":"+355","code":"AL"},{"name":"Algeria","dial_code":"+213","code":"DZ"},{"name":"AmericanSamoa","dial_code":"+1 684","code":"AS"},{"name":"Andorra","dial_code":"+376","code":"AD"},{"name":"Angola","dial_code":"+244","code":"AO"},{"name":"Anguilla","dial_code":"+1 264","code":"AI"},{"name":"Antigua and Barbuda","dial_code":"+1268","code":"AG"},{"name":"Argentina","dial_code":"+54","code":"AR"},{"name":"Armenia","dial_code":"+374","code":"AM"},{"name":"Aruba","dial_code":"+297","code":"AW"},{"name":"Australia","dial_code":"+61","code":"AU"},{"name":"Austria","dial_code":"+43","code":"AT"},{"name":"Azerbaijan","dial_code":"+994","code":"AZ"},{"name":"Bahamas","dial_code":"+1 242","code":"BS"},{"name":"Bahrain","dial_code":"+973","code":"BH"},{"name":"Bangladesh","dial_code":"+880","code":"BD"},{"name":"Barbados","dial_code":"+1 246","code":"BB"},{"name":"Belarus","dial_code":"+375","
@miguelmota
miguelmota / default
Last active January 30, 2023 02:28
Nginx + Node.js server configuration. Blog post: http://www.miguelmota.com/blog/nodejs-and-ngnix-on-ubuntu/
# The upstream module is the link between Node.js and Nginx.
# Upstream is used for proxying requests to other servers.
# All requests for / get distributed between any of the servers listed.
upstream helloworld {
# Set up multiple Node.js webservers for load balancing.
# max_fails refers to number of failed attempts
# before server is considered inactive.
# weight priorities traffic to server. Ex. weight=2 will recieve
# twice as much traffic as server with weight=1
server <your server ip>:3000 max_fails=0 fail_timeout=10s weight=1;
@gemyago
gemyago / generate_dto.sql
Last active September 4, 2023 20:23
TSQL script to generate POCO/DTO from database table
DECLARE @tableName NVARCHAR(MAX), @schemaName NVARCHAR(MAX), @className NVARCHAR(MAX)
--------------- Input arguments ---------------
SET @tableName = 'Incidents'
SET @schemaName = 'dbo'
SET @className = 'IncidentDto'
--------------- Input arguments end -----------
DECLARE tableColumns CURSOR LOCAL FOR
SELECT cols.name, cols.system_type_id, cols.is_nullable FROM sys.columns cols
@lovelykaushik86
lovelykaushik86 / ngFocusOut.js
Created March 4, 2014 10:05
AngularJS ngFocusOut directive - If you are new in angularJs you can use this by adding in your HTML tag. e.g. <input type = "text" ng-focus-out = "$scope.bool = true">
appStrapDirectives.directive('ngFocusOut', function( $timeout ) {
return function( $scope, elem, attrs ) {
$scope.$watch(attrs.ngFocusOut, function( newval ) {
if ( newval ) {
$timeout(function() {
elem[0].focusout();
}, 0, false);
}
});
};
@ocornut
ocornut / imgui_node_graph_test.cpp
Last active April 23, 2024 19:02
Node graph editor basic demo for ImGui
// Creating a node graph editor for Dear ImGui
// Quick sample, not production code!
// This is quick demo I crafted in a few hours in 2015 showcasing how to use Dear ImGui to create custom stuff,
// which ended up feeding a thread full of better experiments.
// See https://github.com/ocornut/imgui/issues/306 for details
// Fast forward to 2023, see e.g. https://github.com/ocornut/imgui/wiki/Useful-Extensions#node-editors
// Changelog
// - v0.05 (2023-03): fixed for renamed api: AddBezierCurve()->AddBezierCubic().
@GabLeRoux
GabLeRoux / .editor
Created September 30, 2015 16:32
Atom split selection into lines (Sublime Text's ctrl+shift+l) From https://discuss.atom.io/t/multiple-selections/755/45
'.platform-win32 .editor, .platform-linux .editor':
'ctrl-shift-L': 'editor:split-selections-into-lines'
'ctrl-shift-up': 'editor:add-selection-above'
'ctrl-shift-down': 'editor:add-selection-below'
@Flix01
Flix01 / imguitabwindow.cpp
Last active August 19, 2023 08:35
ImGui::TabWindow: a self-partitioning ImGui::Window with TabLabels that can be dragged around.
#include "imguitabwindow.h"
#include <imgui_internal.h>
#include <imgui.h> // intellisense
// TODO: Clean this code, it's a mess!
namespace ImGui {
@ignaciotcrespo
ignaciotcrespo / git_clone_branch_only.sh
Last active July 17, 2024 11:18
git clone a specific branch, ONLY the latest commit without history, and wipe out folder before
# wipe out folder. Added manually the .git folders due to cant find a good command to delete everything in macos & linux
rm -rf .git
rm -rf .git*
rm -rf ./*
# clone branch, fast way to get a specific branch without the complete history
git clone -b ${BRANCH_TO_BUILD} --depth 1 --single-branch ${REPO_URL} .
@bkaradzic
bkaradzic / orthodoxc++.md
Last active July 19, 2024 23:17
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?