Skip to content

Instantly share code, notes, and snippets.

View bojanvidanovic's full-sized avatar
🎯
Focusing

Bojan Vidanovic bojanvidanovic

🎯
Focusing
View GitHub Profile
Run this in your Mac Terminal (assuming you have the Ionic CLI):
----------------------------------------------------------------
ionic start wkwebviewpolyfilltest
cd wkwebviewpolyfilltest
ionic setup sass
ionic platform add ios
ionic plugin add https://github.com/EddyVerbruggen/cordova-plugin-wkwebview
ionic build
----------------------------------------------------------------
@jprystowsky
jprystowsky / gist:6357005
Created August 27, 2013 18:11
Demonstrating how to concatenate arrays and then shuffle them (AngularJS).
// This is inside your callbacks, when you have gotten data -- somehow. Replace vars with the correct var names obviously.
$scope.combined = $scope.combined.concat(data);
$scope.combined = shuffle($scope.combined);
// Elsewhere...
function shuffle(array) {
var currentIndex = array.length
,temporaryValue
@habovh
habovh / Wunderground icon names
Created January 13, 2016 17:39
Wunderground icon names returned by the API, in case you handle your own icons that do not have the same name for example.
chanceflurries
chancerain
chancesleet
chancesleet
chancesnow
chancetstorms
chancetstorms
clear
cloudy
flurries
@vinaygopinath
vinaygopinath / place-autocomplete.css
Last active August 15, 2018 06:11
Google maps location/place suggestions with Angular material autocomplete (md-autocomplete) https://plnkr.co/edit/dITwTF?p=preview
/*
Optional adjustments for md-autocomplete in mobile screens
*/
#place-autocomplete > md-autocomplete md-input-container {
margin-top: -10px;
}
/*Media query for tablets and above */
@bendc
bendc / .vimrc
Last active October 11, 2018 18:29
Vim config
set nocompatible
set encoding=utf-8 nobomb
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle
Plugin 'VundleVim/Vundle.vim'
@elberskirch
elberskirch / jekyll-deployment.md
Last active January 16, 2019 03:06
Capistrano deployment for jekyll

introduction

This is a short rundown for setting up deployment for a jekyll blog using a self-hosted git repository and a vserver running nginx. Deployment is done with capistrano (version 3).

Github is probably the most common and most convenient way to host your code for your jekyll blog, but sometimes you might want to keep everything under your own control or you're just curious what barebones git does for you.

setting up the git repository

For setting up a git repository on a linux machine I used this guide. A short wrapup:

  • add a git user
@bendc
bendc / raf-basic-animation.js
Created August 24, 2017 16:45
rAF tutorial: basic animation
const element = document.querySelector("span");
const finalPosition = 600;
const time = {
start: performance.now(),
total: 2000
};
const tick = now => {
time.elapsed = now - time.start;
@li9ht
li9ht / create-swap
Last active May 3, 2020 12:56
configure virtual memory on debian 7x64 digital ocean
#!/bin/sh
sudo fallocate -l 1G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile none swap sw 0 0" >> /etc/fstab
sysctl -w vm.swappiness=30
free
@colllin
colllin / _affixWithinContainer.md
Last active November 29, 2020 17:13
ion-list sticky headers

What this does:

Within an <ion-scroll>, this directive creates sticky item headers that get bumped out of the way by the next item.

Demo: http://cl.ly/2u2X390s0H1a

Requirements:

  • Needs UnderscoreJS for its _.throttle utility.
  • Must be used within an or
@jeremyjaymes
jeremyjaymes / hugo_seo.html
Last active March 21, 2021 08:39
Hugo SEO Markup
<meta name="description" content="{{ if .IsHome }}{{ .Site.Params.description }}{{ else }}{{ .Description }}{{ end }}"/>
<meta name="robots" content="noodp"/>
<link rel="canonical" href="{{ .Permalink }}" />
<!-- Twitter Card -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:description" content="{{ if .IsHome }}{{ .Site.Params.description }}{{ else }}{{ .Description }}{{ end }}" />
<meta name="twitter:title" content="{{ .Title }}{{ if .IsHome }} - {{ .Site.Params.Tagline }}{{ else }} - {{ .Site.Title }}{{ end }}" />
<meta name="twitter:site" content="{{ .Site.Params.twitter }}" />
<meta name="twitter:creator" content="{{ .Site.Params.twitter }}" />