Skip to content

Instantly share code, notes, and snippets.

// TODO this will be removed after: https://github.com/angular/angular-cli/issues/8046
const replace = require('replace-in-file');
const filesToFix = [
{
files: 'node_modules/@angular/cli/models/webpack-configs/typescript.js',
from: [/\.ts\$/g, /\\.ts\)\$/],
to: ['.(ts|tsx)$', '\\.ts|\\.tsx)$']
},
{
anonymous
anonymous / config.json
Created December 19, 2016 20:53
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
@alirobe
alirobe / reclaimWindows10.ps1
Last active April 26, 2024 17:59
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@tjade273
tjade273 / Database.sol
Last active April 6, 2024 04:32
Example of separated storage and logic
contract Database{
mapping(uint => uint) public _data;
mapping(address => bool) _owners;
function Database(address[] owners){ //Called once at creation, pass in initial owners
for(uint i; i<owners.length; i++){
_owners[owners[i]]=true;
}
}
@piecioshka
piecioshka / getTextWidth.js
Last active March 11, 2019 11:10
[get text long in pxs] Uses canvas.measureText to compute and return the width of the given text of given font in pixels #Canvas
/**
* Uses canvas.measureText to compute and return the width of the given text of given font in pixels.
*
* @param {String} text The text to be rendered.
* @param {String} font The css font descriptor that text is to be rendered with (e.g. "bold 14px verdana").
*
* @see http://stackoverflow.com/questions/118241/calculate-text-width-with-javascript/21015393#21015393
*/
function getTextWidth(text, font) {
// if given, use cached canvas for better performance