Skip to content

Instantly share code, notes, and snippets.

View kjellberg's full-sized avatar
🎯
Focusing

Rasmus Kjellberg kjellberg

🎯
Focusing
View GitHub Profile
# Obs inte testat såklart.
class BankidAuthController
def callback # omniauth? callback
personnummer = params[:personnummer] # from bankid callback
bankid_user = BankidUser.first_or_create(personnummer: personnummer)
if bankid.user.present?
sign_in_and_redirect bankid_user.user # Devise method
else
# BEGIN WP Rocket v3.1.4
# Use UTF-8 encoding for anything served text/plain or text/html
AddDefaultCharset UTF-8
# Force UTF-8 for a number of file formats
<IfModule mod_mime.c>
AddCharset UTF-8 .atom .css .js .json .rss .vtt .xml .woff2
</IfModule>
# FileETag None is not enough for every server.
<IfModule mod_headers.c>
@kjellberg
kjellberg / web.config
Last active March 31, 2021 14:06
100% Page Speed Score - Azure Wordpress site with gzip compression + leverage browser caching + wp super cache expert mode
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="wp super cache" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" />
<add input="{QUERY_STRING}" pattern=".*=.*" negate="true" />
alias sysc="sudo sysctl -w kern.maxfiles=5242880 && sudo sysctl -w kern.maxfile$
alias rsrv="bundle exec rails server -b 0.0.0.0"
alias rcons="bundle exec rails console"
alias rguard="bundle exec rails guard"
alias grd="bundle exec rails guard"
alias rdeploy="bundle exec cap production deploy"
alias rmig="bundle exec rake db:migrate"
alias rgen="bundle exec rails generate"
@kjellberg
kjellberg / rasper.sol
Last active September 17, 2017 22:43
rasper
pragma solidity ^0.4.16;
contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); }
contract Rasper {
/* Public variables of the RASPER token */
string public standard = 'RASPER 1.1';
string public name = 'Rasper';
string public symbol = 'RSPR';
uint8 public decimals = 16;
uint256 public totalSupply = 1000000000000000000000000;
@kjellberg
kjellberg / rinkeby
Created September 17, 2017 17:05
rikeby
0x4A47802F2333F4C497A68553584232F1d235c352
@kjellberg
kjellberg / 0xF10Ca11059e6c933de7ACb06BD9506CE72a1834c
Created September 17, 2017 16:24
0xF10Ca11059e6c933de7ACb06BD9506CE72a1834c
0xF10Ca11059e6c933de7ACb06BD9506CE72a1834c
@kjellberg
kjellberg / mack
Created September 10, 2017 12:52
<script>
document.addEventListener( 'wpcf7mailsent', function( event ) {
ga('send', 'event', 'Contact Form', 'submit');
}, false );
</script>
# 4 space indentation
[*.py]
indent_style = space
indent_size = 4
# 4 space indentation
[*.php]
indent_style = tab
indent_size = 4
alias rsrv="bundle exec rails server"
alias rcons="bundle exec rails console"
alias rguard="bundle exec rails guard"
alias grd="bundle exec rails guard"
alias rdeploy="bundle exec cap production deploy"
alias rmig="bundle exec rake db:migrate"
alias rgen="bundle exec rails generate"