Skip to content

Instantly share code, notes, and snippets.

View tolu's full-sized avatar

Tobias Lundin tolu

  • Elate
  • Oslo, Norway
View GitHub Profile
@tolu
tolu / oneClickSetup
Last active September 13, 2016 07:54
One click install of chocolatey and a bunch of nice to have apps.
@echo off
::check if chocolatey is installed
set chocolateyDir=%systemdrive%\chocolatey
IF EXIST %chocolateyDir% goto already-installed
echo installing chocolatey...
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%chocolateyDir%\bin
:: refresh environment variables to be able to call
@tolu
tolu / module.js
Created August 17, 2014 13:58
JS module
(function (definition) {
// Turn off strict mode for this function so we can assign to global
/* jshint strict: false */
// This file will function properly as a <script> tag, or a module
// using CommonJS and NodeJS or RequireJS module formats. In
// Common/Node/RequireJS, the module exports the API and when
// executed as a simple <script>, it creates a global instead.
// Montage Require
@tolu
tolu / saveAnyFileInLocalStorage
Last active August 29, 2015 14:10
Save any file in localStorage.
function fixAkamaiEOL(url, callback) {
// create XHR, Blob and FileReader
var xhr = new XMLHttpRequest();
var fileReader = new FileReader();
var blob;
xhr.open("GET", url, true);
// set responseType to arraybuffer
xhr.responseType = "arrayBuffer";
@tolu
tolu / TeamCityNode.cmd
Last active May 20, 2016 23:44
TeamCity helper for Node-based commands (grunt, gulp for now)
:: https://gist.github.com/tolu/d867c4ef9581251b46dc
@echo off
:: Expects to be called with [command] [params*]
:: Where command is either "grunt" or "gulp"
:: File executes command and prints TeamCity separators
:: 1. Makes sure that global version of command is installed
:: 2. Calls npm install in current directory
:: 3. Calls command with provided [params]
:: 4. Prints time of execution
@tolu
tolu / ffmpeg.md
Last active December 6, 2016 01:20
ffmpeg Usage

ffmpeg HowTo

Ripping

DVD

From ripping-dvd-with-ffmpeg

ffmpeg -i concat:VTS_01_1.VOB\|VTS_01_2.VOB\|VTS_01_3.VOB -map 0:v -map 0:a -c:v libx264 -crf 18 -vf yadif -c:a flac aikido.mkv
#BoxStarterConfigFile
#Basic Setup
Update-ExecutionPolicy Unrestricted
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
#Windows Features
cinst Microsoft-Hyper-V-All -source windowsfeatures
cinst IIS-WebServerRole -source windowsfeatures
cinst IIS-HttpCompressionDynamic -source windowsfeatures
@tolu
tolu / A-ES6-examples-readme.md
Last active September 10, 2018 08:32
Modern javascript examples with old counterparts
@tolu
tolu / 0.ES6-issues.md
Created August 15, 2016 09:56
ES6 pitfalls and potential danger zones with babel & webpack

ES6 issues

Just a bunch of examples of errors that are potentially hard to find and that eslint does not break on

  1. Temporal dead zones
  2. Cyclic dependencies
@tolu
tolu / google_drive_hosting.md
Last active June 13, 2017 11:51
Host images on Google Drive

Google Drive hosting

Use the Get Link option in Google Drive to get the URL.
Use <img src=""> tag in HTML (or the link syntax ![alt text](image-url)) and paste the link in there.
Change Open? in the URL to uc?.

Bug
![BUG][bug]

@tolu
tolu / readme.md
Last active August 23, 2018 08:12
Setup Mac

New Mac Setup

  1. install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

brew update
brew doctor