Skip to content

Instantly share code, notes, and snippets.

View weiland's full-sized avatar
🍫
🎓 && 💻 #GitHubDropICE

Pascal Weiland weiland

🍫
🎓 && 💻 #GitHubDropICE
View GitHub Profile
@weiland
weiland / Readme.md
Created November 26, 2014 20:34
jetbrains ide fix on mac os x yosemite

one has to change the required version number of Java to 1.*

Open /Applications/PhpStorm.app/Contents/Info.plist

<key>JVMVersion</key>
<string>1.*</string>
@weiland
weiland / xhr-donwload.html
Created November 19, 2014 20:29
simple xhr downloader
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>xhr donwload</title>
</head>
<body>
<script>
var uri = 'https://domain.com/video.mp4';
var xhr = new XMLHttpRequest();
@weiland
weiland / ItemsService.js
Last active March 15, 2016 12:21
Angular
(function () {
/**
* Deferred ItemsService
*/
function ItemsService($log, $http, $window, ENV) {
var ItemsService = {};
ItemsService.items = [];
@weiland
weiland / xpath.js
Created November 14, 2014 18:56
xpath all links
Array.prototype.slice.call($x('//*[@id="mw-content-text"]/table/tbody/tr[*]/td[3]/a')).forEach(function(e,i) {console.log(e.href);})
@weiland
weiland / Package Control.sublime-settings
Last active April 28, 2016 08:18
sublime 3 install package control
{
"in_process_packages":
[
],
"installed_packages":
[
"Alternate VIM Navigation",
"AutoFileName",
"Babel",
"Better CoffeeScript",
@weiland
weiland / console-shim.js
Created October 30, 2014 09:54
Console shim
(function( window ) {
if ( window.console ) {
return;
}
window.console = (function() {
var methods = 'assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,table,time,timeEnd,timeStamp,trace,warn'.split(','),
console = {},
@weiland
weiland / preloaderService.js
Last active August 29, 2015 14:07
Angular Image Preloader Service
(function () {
function PreloaderService( $http, $window, $q, ENV ) {
var PreloaderService = {};
PreloaderService.imageUrls = [];
PreloaderService.addImage = function ( imageUrl ) {
PreloaderService.imageUrls.push( imageUrl )
};
@weiland
weiland / defer.js
Created September 29, 2014 18:35
load deferred javascript files - (best practise, i tell ya!)
// put tis at the end of the body
function loadDeferred( ) {
var s = document.createElement( 'script' );
s.src = 'defer.js'; // concat all scripts which can be loaded deferred (listeners etc)
document.body.appendChild( s );
}
if ( window.addEventListener ) {
window.addEventListener( "load", loadDeferred, false );
}
@weiland
weiland / angular-trusted-sce-filer.js
Created September 25, 2014 08:49
Angular Strict Contextual Escaping Service Provider as a filter
(function () {
function trusted($sce) {
return function (url) {
return $sce.trustAsResourceUrl(url);
};
}
trusted.$inject = ['$sce'];
@weiland
weiland / README.md
Last active August 29, 2015 14:06
Set Spotify Pride Icon

Set Spotify Pride Icon

use the shell script or just the following command:

curl -o icon.icns https://dl.dropboxusercontent.com/content_link/heqIreR1Wns4PEo1N0DZEbxrBUBYi12tFOMJUJKGyPdHgGPbtoOFbmaGIQsWgfC3 && sudo cp ./icon.icns /Applications/Spotify.app/Contents/Resources/icon.icns