Skip to content

Instantly share code, notes, and snippets.

View AlexLaforge's full-sized avatar

Alex Laforge AlexLaforge

  • Reims, France.
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<script src="http://cdn.jsdelivr.net/chartist.js/latest/chartist.min.js"></script>
<link href="http://cdn.jsdelivr.net/chartist.js/latest/chartist.min.css" rel="stylesheet" type="text/css" />
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
body {
background-color: #333;
@AlexLaforge
AlexLaforge / ShellBrowse.vbs
Created June 7, 2019 14:57 — forked from mlhaufe/ShellBrowse.vbs
VBScript File Browser
Option Explicit
' Flags for the options parameter
Const BIF_returnonlyfsdirs = &H0001
Const BIF_dontgobelowdomain = &H0002
Const BIF_statustext = &H0004
Const BIF_returnfsancestors = &H0008
Const BIF_editbox = &H0010
Const BIF_validate = &H0020
Const BIF_browseforcomputer = &H1000
@AlexLaforge
AlexLaforge / BrowseForFile.vbs
Created June 6, 2019 18:03 — forked from simply-coded/BrowseForFile.md
Browse for file dialog box in VBScript.
Function BrowseForFile()
'@description: Browse for file dialog.
'@author: Jeremy England (SimplyCoded)
BrowseForFile = CreateObject("WScript.Shell").Exec( _
"mshta.exe ""about:<input type=file id=f>" & _
"<script>resizeTo(0,0);f.click();new ActiveXObject('Scripting.FileSystemObject')" & _
".GetStandardStream(1).WriteLine(f.value);close();</script>""" _
).StdOut.ReadLine()
End Function
@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()
@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 / 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 / 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)
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 / 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);
@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"-->
<%