Skip to content

Instantly share code, notes, and snippets.

View AlexLaforge's full-sized avatar

Alex Laforge AlexLaforge

  • Reims, France.
View GitHub Profile
@AlexLaforge
AlexLaforge / IIS Rewrite Cheat Sheet
Created November 10, 2015 15:10 — forked from developerdizzle/IIS Rewrite Cheat Sheet
IIS Rewrite Cheat Sheet
<rewrite>
<!-- Have a bunch of redirects? Put them in a separate file -->
<rules configSource="Rewrites.config" />
<rules>
<!-- Simple rewrite -->
<rule name="Simple rewrite" stopProcessing="true">
<match url="^path/sub path/page\.aspx$" />
<action type="Rewrite" url="/newpath.aspx" />
@AlexLaforge
AlexLaforge / pulsate_path.css
Created August 2, 2016 20:31 — forked from lorenzoplanas/pulsate_path.css
Pulsating SVG Path
.pulsate path {
stroke: #2980b9;
-webkit-animation: pulsate 5s ease-out;
-webkit-animation-iteration-count: infinite;
-moz-animation: pulsate 5s ease-out;
-moz-animation-iteration-count: infinite;
-ms-animation: pulsate 5s ease-out;
-ms-animation-iteration-count: infinite;
animation: pulsate 5s ease-out;
animation-iteration-count: infinite;
@AlexLaforge
AlexLaforge / web.config.markdown
Created February 18, 2017 08:34 — forked from marcbarry/machine.config.markdown
Security hardening pointers for web.config

Security hardening web.config

For a complete template see this Gist

Disable tracing
<system.web>
  <trace enabled="false" />
@AlexLaforge
AlexLaforge / Page.asp
Created May 12, 2017 20:10 — forked from joseph-montanez/Page.asp
ASP Classic example of REST / JSON call
<%@ Language="VBScript" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<!--#include file="json.asp"-->
<%
@AlexLaforge
AlexLaforge / query-string-example.js
Created January 21, 2018 13:33 — forked from sindresorhus/query-string-example.js
Get, set, modify url parameters in a query string with JavaScript.
// Get the queryString module from:
// https://github.com/sindresorhus/query-string
console.log(location.href);
// http://sindresorhus.com/?foo=bar
console.log(location.search);
// ?foo=bar
var parsed = queryString.parse(location.search);
import UIKit
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
@IBOutlet weak var tableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
NSLayoutConstraint.activate([
tableView.topAnchor.constraint(equalTo: view.topAnchor),
@AlexLaforge
AlexLaforge / commands.txt
Created March 10, 2018 09:47 — forked from JesseRWeigel/commands.txt
ImageMagick Compression Commands
// Must install ImageMagick first
http://www.imagemagick.org/script/index.php
//This compresses a jpg with no visible loss of quality. Add in your own file names for target.jpg and result.jpg
convert -strip -interlace Plane -sampling-factor 4:2:0 -quality 85% target.jpg result.jpg
// This does the same as above but to an entire folder (will overwrite original files):
mogrify -strip -interlace Plane -sampling-factor 4:2:0 -quality 85% *.jpg
//This does the same thing but to all subfolders as well (Be careful with this one it will overwrite all original files)
@AlexLaforge
AlexLaforge / SassMeister-input.scss
Created May 20, 2018 05:36 — forked from blackfalcon/SassMeister-input.scss
Update single value in a Sass map
// ----
// libsass (v3.1.0-beta)
// ----
$map-one: (color: orange, height: 100px);
.block {
color: map-get($map-one, color);
}
@AlexLaforge
AlexLaforge / DateTimeConvert.asp
Created July 2, 2018 13:19 — forked from radleta/DateTimeConvert.asp
Date and Time conversion local to and from UTC for ASP.
<%
' ****************************************************************************
' Sub: GetUtcOffsetMinutes
' Description: Gets the number of minutes between local time and UTC.
'
' Params: None
' ****************************************************************************
Function GetUtcOffsetMinutes()
@AlexLaforge
AlexLaforge / what-forces-layout.md
Created July 8, 2018 03:34 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()