Skip to content

Instantly share code, notes, and snippets.

View netzfisch's full-sized avatar
🐋
swim w/ friends

harm netzfisch

🐋
swim w/ friends
View GitHub Profile
@sharu725
sharu725 / subscribe-form.html
Last active July 9, 2024 02:04
Jekyll Subscribe Form using Mailchimp
<!--
Before implementing this jekyll snippet make sure
1. you have signed up with Mailchimp.
2. you have created a list in Mailchimp.
3. you have defined the list in _config.yml,
for ex: "mailchimp-list: //redgadgets.us10.list-manage.com/subscribe/post?u=210acce5db69d3d4a04b0e25d&amp;id=08c6708f40"
-->
<form action="{{site.mailchimp-list}}" method="post" name="mc-embedded-subscribe-form" class="wj-contact-form validate" target="_blank" novalidate>
<div class="mc-field-group">
@mislav
mislav / nginx.conf
Last active April 23, 2017 10:03
SSL nginx configuration for my personal site using Let's Encrypt https://certbot.eff.org/#ubuntutrusty-nginx
# primary HTTPS config
server {
listen 443 ssl;
server_name mislav.net;
ssl_certificate /etc/letsencrypt/live/mislav.net/cert.pem;
ssl_certificate_key /etc/letsencrypt/live/mislav.net/privkey.pem;
root /home/app/blog/_site;
index index.html;
@thomasdarimont
thomasdarimont / readme.md
Last active July 1, 2024 09:43
Example for decoding a JWT Payload with your Shell (bash, zsh...)

Setup

Add this to your .profile, .bashrc, .zshrc...

decode_base64_url() {
  local len=$((${#1} % 4))
  local result="$1"
  if [ $len -eq 2 ]; then result="$1"'=='
  elif [ $len -eq 3 ]; then result="$1"'=' 
  fi
 echo "$result" | tr '_-' '/+' | openssl enc -d -base64
# Rake task to help migrating a rails 3 app to rails 4 strong_parameters.
# The task generates source code for helper methods for each model class
# to 'permit' the attributes.
# the generated methods are intended as starting point to copy&paste in the controller
# and than edit the permitted attributs.
# Some common names of non-editable attributes are already filtered,
# like 'id', 'password' or 'created_at'.
# The output is written to stdout so you can pipe it into a file
#
# Dependencies:
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@vernak2539
vernak2539 / fuelux-datepicker-examples.html
Last active December 29, 2015 00:49
Fuel UX Datepicker Examples
<!--
///////////////////////////////////////////////////////////////////////
// These examples apply to Fuel UX v2.*
// If you're looking for Fuel UX v3 please checkout the examples here
// - https://gist.github.com/vernak2539/9980566
/////////////////////////////////////////////////////////////////////////
-->
<!-- standard markup of datepicker -->
<div class="datepicker dropdown" id="myDatepicker">
<div class="input-append">
@alex-zige
alex-zige / gist:5795358
Last active June 8, 2023 07:49
Rails Rspec API Testing Notes

Rails Rspec APIs Testing Notes

Folders Structure

  spec
  |--- apis #do not put into controllers folder. 
        |--- your_api_test_spec.rb  
  |--- controllers
  |--- models
  |--- factories
 |--- views
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
# Git
alias gs="git status"
alias ga="git add"
alias go="git checkout"
alias gc="git commit"
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
alias gp="git push"
@dnagir
dnagir / rspec-syntax-cheat-sheet.rb
Created November 5, 2010 09:29
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")