Skip to content

Instantly share code, notes, and snippets.


Christian Hjalmarsson jnx

View GitHub Profile
jnx /
Created Oct 15, 2018 — forked from maximilian-lindsey/
How to run Express inside an Electron app

How to run Express inside an Electron app

You can run your Express app very easily inside your Electron app.

All you need to do is to:

  • place all the files of your Express app inside a new app folder in your_electron_app\resources\app
  • reconfigure the app.js file
  • refactor some relative pathes in your Express app
jnx / nginx-config.conf
Created Jan 3, 2018 — forked from konovalov-nk/nginx-config.conf
Useful nginx SSL hardened (letsencrypt) config for setting up Rails application with Puma webserver
View nginx-config.conf
upstream myappdev {
server unix:///home/your_user/git/;
# don't forget to add this to server {..} block
# add_header X-Xss-Protection "1; mode=block";
server {
listen 80;
listen 443 ssl http2;
jnx / recursive-division.rb
Created Nov 9, 2017 — forked from jamis/recursive-division.rb
An implementation of the "Recursive Division" algorithm for maze generation.
View recursive-division.rb
# --------------------------------------------------------------------
# An implementation of the "Recursive Division" algorithm. This is a
# kind of fractal maze algorithm, recursively dividing the maze into
# smaller and smaller cells. This algorithm stops at the integer
# boundary, but theoretically the algorithm could continue infinitely
# to smaller and smaller scales.
# Note that this algorithm is implemented as a "wall adder", rather
# than a "passage carver", so the meaning of the bits in each cell
# is reversed: instead of the S bit (for instance) meaning "a passage
jnx / Getting some equivalent of using nginx and dnsmasq on non-Apple *NIX

Install nginx and dnsmasq

Using apt-get/dnf/pkg_add/ports/rpm/pacman/whatever...

Add necessary config files


# /etc/dnsmasq.d/dev
jnx / git_aliases.zsh
Created Sep 13, 2016
git and git-flow aliases
View git_aliases.zsh
alias gft="git fetch --tags"
alias gpt="git push --tags"
alias gcm="git checkout master"
alias gmm="git merge master"
alias gcd="git checkout develop"
alias gmd="git merge develop"
gcf() { git checkout feature/$1; }
View new_invitation.html.erb
<!-- /app/views/admin/users/new_invitiations.html.erb -->
<h2>Send invitation</h2>
<%= form_for @user, :url => send_invitation_admin_users_path do |f| %>
<table style='width: 50%'>
<td><%= f.label :first_name %></td>
<td><%= f.text_field :first_name %></td>
View add.js.erb
<td><%=@key.split(".").drop(1) %></td>
<td><%= @value%></td>
View spec_helper.rb
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rubygems'
gem 'minitest'
require 'minitest/autorun'
require 'action_controller/test_case'
require 'miniskirt'
require 'capybara/rails'
View gist:6409792
function precmd() {
if command git rev-parse --git-dir > /dev/null 2>&1; then
window_label=$(git rev-parse --show-toplevel)
tab_label=$(echo $window_label | awk -F\/ '{print "[git] " $NF}')
echo -ne "\e]2;${window_label}\a"
echo -ne "\e]1;${tab_label: -24}\a"
View gist:5676867
require 'mogli'
module FacebookIntegrationHelpers
shared_context "with unconnected facebook user" do
let(:fb_user) { create_test_user(installed: false) }
after { fb_user.destroy }
def app_client, AppConfig.facebook.app_id)
You can’t perform that action at this time.