Skip to content

Instantly share code, notes, and snippets.

View StefanWallin's full-sized avatar
🌍
💚

Stefan Wallin StefanWallin

🌍
💚
View GitHub Profile
@StefanWallin
StefanWallin / plugin_name.js
Created October 8, 2015 10:27
Javascript jQuery namespaced functionality nugget
document.mittmedia = document.mittmedia || {};
(function(object, jQuery, ...dependencies...){
object.plugin_name = {
elements: {
},
init: function(){
this.gatherElements()
this.bindEventHandlers()
},
gatherElements: function(){
class AddFlagsToHuman < ActiveRecord::Migration
def change
# Add the flags
add_column :humen, :signed_up, :boolean, default: false
add_column :humen, :welcome_email_sent, :boolean, default: false
# Set the flags values
reversible do |dir|
dir.up do
Humen.all.select(&:signed_up?).each do |human|
@StefanWallin
StefanWallin / mediaquery scss
Created June 14, 2015 19:58
Could this be done better? The media query is sooo out of place...
#teamroster {
overflow: hidden;
@media (min-width: 600px) {
.team-display {
float: left;
overflow: hidden;
width: 30.3333333%;
margin-right: 1.5%;
min-width: 30%;
@StefanWallin
StefanWallin / 1. Error message
Last active February 24, 2016 16:48
Including static images in React Native not working :(
Requiring unknown module "image!backdrop". If you are sure the module is there, try restarting the packager.

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@StefanWallin
StefanWallin / debian-aptitude-issue.md
Created November 28, 2014 12:26
Debian 6.0.7 update issue after long aptitude pause

#debian update issue

root@blueberry:/home/festiz# cat /etc/debian_version
6.0.7
root@blueberry:/home/festiz# aptitude update
Läs:1 http://ftp.se.debian.org stable Release.gpg [1 655 B]
@StefanWallin
StefanWallin / Skandiabanken-issues.md
Created November 27, 2014 14:10
Issues with Skandiabanken.

Saker som nyligen stört mig på Skandiabanken.

  • Att betalningar som inte går igenom och håller på att omförsökas inte skickar en pushnotis/mail/sms till mig om att så är fallet.
  • Att betalningar som inte går igenom och håller på att omförsökas inte kan flyttas till ett av mina andra konton som har täckning.
  • Att e-faktura inte kan anmälas via mobilbanken.
  • Att man inte kan fritextsöka på meddelanden eller kontonummer när man söker transaktioner utan bara datum och belopp.
  • Att personen i kundsupportchatten tog 6 minuter mellan varje fråga och svar, och bara svarade på den första av mina frågor i en sammanklumpad frågemening.
@StefanWallin
StefanWallin / nginx.conf
Last active August 29, 2015 14:08 — forked from konklone/ssl.rules
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email eric@konklone.com.
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {
@StefanWallin
StefanWallin / nginx.conf
Last active August 29, 2015 14:08 — forked from konklone/ssl.rules
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email eric@konklone.com.
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {
@StefanWallin
StefanWallin / nginx.conf
Last active August 29, 2015 14:08 — forked from konklone/ssl.rules
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email eric@konklone.com.
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {