Skip to content

Instantly share code, notes, and snippets.

View gustaflindqvist's full-sized avatar
🚴‍♂️
Focusing

Gustaf Lindqvist gustaflindqvist

🚴‍♂️
Focusing
View GitHub Profile
The value "device-width;" for key "width" is invalid, and has been ignored. alpint-stortlopp-traning-27963.html:8
The value "1.0;" for key "initial-scale" was truncated to its numeric prefix. alpint-stortlopp-traning-27963.html:8
The value "1.0;" for key "maximum-scale" was truncated to its numeric prefix. alpint-stortlopp-traning-27963.html:8
Error parsing a meta element's content: ';' is not a valid key-value pair separator. Please use ',' instead. alpint-stortlopp-traning-27963.html:8
Resource interpreted as Script but transferred with MIME type text/html: "http://os.viaplay.se/live/live.json?callback=D3PodiumLiveEvents&_=1391678355563". frameworks.js?20140126093037:207
body.scrollTop is deprecated in strict mode. Please use 'documentElement.scrollTop' if in strict mode and 'body.scrollTop' only if in quirks mode. page_context.js:225
body.scrollLeft is deprecated in strict mode. Please use 'documentElement.scrollLeft' if in strict mode and 'body.scrollLeft' only if in quirks mode. page_context.js:225
Uncau
class ActiveRecord::Base
def can_destroy?
self.class.reflect_on_all_associations.all? do |assoc|
assoc.options[:dependent] != :restrict || (assoc.macro == :has_one && self.send(assoc.name).nil?) || (assoc.macro == :has_many && self.send(assoc.name).empty?)
end
end
end
@gustaflindqvist
gustaflindqvist / AppDelegate.swift
Created July 20, 2014 21:06
Possible solution
var appToken = "<YOUR-APP-TOKEN>"
Lookback.setupWithAppToken(appToken)
var lookback: Lookback = Lookback()
lookback.shakeToRecord = true;

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@gustaflindqvist
gustaflindqvist / sv.yml
Last active August 29, 2015 14:15 — forked from lindblom/sv.yml
# Det måste vara en tom rad här av någon anledning :)
sv:
date:
formats:
default: "%Y-%m-%d"
short: "%b %d"
long: "%B %d, %Y"
day_names: [Söndag, Måndag, Tisdag, Onsdag, Torsdag, Fredag, Lördag]
abbr_day_names: [Sön, Mån, Tis, Ons, Tors, Fre, Lör]
@gustaflindqvist
gustaflindqvist / media-queries.scss
Created June 30, 2016 09:15 — forked from chrisl8888/media-queries.scss
All Media Queries breakpoints
@media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ }
@media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */ }
@media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */ }
@media (min-width:801px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ }
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ }
@media (min-width:1281px) { /* hi-res laptops and desktops */ }
webpack --display-modules | awk '{print $3$4" "$2}' | grep -v bytes | sort -n | tail -100
@gustaflindqvist
gustaflindqvist / sticky.js
Created December 16, 2016 13:11 — forked from javierarques/sticky.js
Sticky Sideabr With Vanilla Javascript. Detects scroll and set fixed the element. Live example: http://codepen.io/javiarques/pen/vKdgjR
// Sticky Nav Component
var Sticky = (function() {
'use strict';
var CSS_CLASS_ACTIVE = 'is-fixed';
var Sticky = {
element: null,
position: 0,
addEvents: function() {
@gustaflindqvist
gustaflindqvist / keybindings.json
Created February 9, 2017 09:43
VSCode keybindings
[
{ "key": "cmd+shift+d", "command": "editor.action.copyLinesDownAction",
"when": "editorTextFocus" },
{ "key": "cmd+shift+7", "command": "editor.action.commentLine",
"when": "editorTextFocus" }
]
@gustaflindqvist
gustaflindqvist / .bashrc
Created February 11, 2017 17:59
ssh-agent
SSH_ENV=$HOME/.ssh/environment
# start the ssh-agent
function start_agent {
echo "Initializing new SSH agent..."
# spawn ssh-agent
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null