Skip to content

Instantly share code, notes, and snippets.

View raphaelcarlosr's full-sized avatar
👨‍💻
Focusing

raphaelcarlosr.dev raphaelcarlosr

👨‍💻
Focusing
View GitHub Profile
/*
By Osvaldas Valutis, www.osvaldas.info
Available for use under the MIT License
*/
;( function( $, window, document, undefined )
{
var s = document.body || document.documentElement, s = s.style, prefixAnimation = '', prefixTransition = '';
if( s.WebkitAnimation == '' ) prefixAnimation = '-webkit-';
@raphaelcarlosr
raphaelcarlosr / modal-fullscreen.css
Created March 1, 2018 12:22 — forked from soham2008xyz/modal-fullscreen.css
Bootstrap 3 transparent and fullscreen modals
/* .modal-fullscreen */
.modal-fullscreen {
background: transparent;
}
.modal-fullscreen .modal-content {
background: transparent;
border: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
@raphaelcarlosr
raphaelcarlosr / jQuery.ajaxQueue.min.js
Created August 8, 2018 20:48 — forked from gnarf/jQuery.ajaxQueue.min.js
jQuery.ajaxQueue - A queue for ajax requests
/*
* jQuery.ajaxQueue - A queue for ajax requests
*
* (c) 2011 Corey Frang
* Dual licensed under the MIT and GPL licenses.
*
* Requires jQuery 1.5+
*/
(function(a){var b=a({});a.ajaxQueue=function(c){function g(b){d=a.ajax(c).done(e.resolve).fail(e.reject).then(b,b)}var d,e=a.Deferred(),f=e.promise();b.queue(g),f.abort=function(h){if(d)return d.abort(h);var i=b.queue(),j=a.inArray(g,i);j>-1&&i.splice(j,1),e.rejectWith(c.context||c,[f,h,""]);return f};return f}})(jQuery)
@raphaelcarlosr
raphaelcarlosr / async-task-queue.js
Created August 8, 2018 20:49 — forked from paolorossi/async-task-queue.js
Javascript Queue for sequencing AJAX requests and other asynchronous tasks. Demo http://jsfiddle.net/rusci/26Dud/6/
// Queue class for serializing AJAX calls.
//
// Inspired by Raynos http://stackoverflow.com/a/4797596/1194060
//
// Queue has a public append method that expects some kind of task.
// A task is a generic function passed as callback.
// Constructor expects a handler which is a method that takes a ajax task
// and a callback. Queue expects the handler to deal with the ajax and run
// the callback when it's finished
@raphaelcarlosr
raphaelcarlosr / oneliners.js
Created April 1, 2019 16:55 — forked from mikowl/oneliners.js
👑 Awesome one-liners you might find useful while coding.
// By @coderitual
// https://twitter.com/coderitual/status/1112297299307384833
// Remove any duplicates from an array of primitives.
const unique = [...new Set(arr)]
// Sleep in async functions. Use: await sleep(2000).
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms)));
// Type this in your code to break chrome debugger in that line.
@raphaelcarlosr
raphaelcarlosr / plink-plonk.js
Created February 17, 2020 18:32 — forked from tomhicks/plink-plonk.js
Listen to your web pages
@raphaelcarlosr
raphaelcarlosr / CustomerController.cs
Created May 21, 2020 18:04 — forked from mgroves/CustomerController.cs
Audit ActionFilter in ASP.NET MVC
public class CustomerController : Controller
{
public ViewResult Index()
{
return View();
}
public ViewResult Edit()
{
var existingCustomer = new Customer();
@raphaelcarlosr
raphaelcarlosr / package.json
Created July 16, 2020 13:30 — forked from adamreisnz/package.json
Simple pure npm scripts build process
{
"name": "project-name",
"description": "Template for static sites",
"version": "1.0.0",
"homepage": "http://www.project-name.com",
"author": {
"name": "Adam Reis",
"url": "http://adam.reis.nz"
},
"license": "UNLICENSED",
# Simple PowerShell script to load-test / test REST api with headers and cookies.
# Harald S. Fianbakken
$headers = @{
"Accept"= "application/zip";
"Accept-Encoding"= "gzip,deflate,sdch";
"My-Token-ID" = "This_is_a_test";
};
function Create-Cookie($name, $value, $domain, $path="/"){
@raphaelcarlosr
raphaelcarlosr / PingUrlParallel.ps1
Last active February 2, 2021 17:37 — forked from Buthrakaur/PingUrlParallel.ps1
Simple load test tool in powershell
workflow PingUrlParallel {
param(
[string]$url,
[int]$parallelCount = 10,
[int]$iterations = 10
)
foreach -parallel ($x in 1..$parallelCount) {
1..$iterations | %{