Skip to content

Instantly share code, notes, and snippets.

View Fallenstedt's full-sized avatar
:octocat:
Having fun

Alexander Fallenstedt Fallenstedt

:octocat:
Having fun
View GitHub Profile
@xssfox
xssfox / README.md
Last active October 15, 2024 15:22
basic ax25 setup

Software

sudo apt-get install direwolf ax25-apps ax25-tools

Setting up direwolf

Direwolf is our software TNC

@kdrmlhcn
kdrmlhcn / multiple_ssh_setting.md
Last active March 22, 2023 18:43 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "email@work_mail.com" -f "id_rsa_work_user1"
@Fallenstedt
Fallenstedt / keybase.md
Created June 9, 2020 04:04
keybase.md

Keybase proof

I hereby claim:

  • I am fallenstedt on github.
  • I am fallenstedt (https://keybase.io/fallenstedt) on keybase.
  • I have a public key ASC9XKEzj4DsJZDXNeszL8jAlaLxCHhC1esNgTCRlTXaUQo

To claim this, I am signing this object:

@gh0st026
gh0st026 / docker_export_postgre_table.sh
Last active February 13, 2023 02:15
Dump PostgreSQL Table in docker container as CSV file
CONTAINER="name"
DB="Db name"
TABLE="Table Name"
FILE="file.csv"
sudo docker exec -u postgres ${CONTAINER} psql -d ${DB} -c "COPY ${TABLE} TO STDOUT WITH CSV HEADER " > ${FILE}
@DomiR
DomiR / observable-queue.ts
Created March 11, 2018 18:54 — forked from evxn/observable-queue.ts
Add Observable-like entities to a queue (Promises, Observables, Subjects, Arrays, generators, Iterables). After each stream is completed (i.e. Promise resolved) it's elements are emitted to the result stream in the order of addition (first in first out). Each subscriber receives result only for items added to queue after the subscription.
import {Subject} from 'rxjs/Subject';
import {BehaviorSubject} from 'rxjs/BehaviorSubject';
import {Observable, ObservableInput} from 'rxjs/Observable';
import {concatMap, switchMap} from 'rxjs/operators';
enum QueueActions {
RESET = 'RESET',
ADD = 'ADD',
}
@phuochau
phuochau / sample_configuration.js
Last active March 26, 2018 17:46
Sample configuration for using Jest and vue-test-utils in nuxt.js project
// package.json
"jest": {
"roots": [
"<rootDir>/tests/unit"
],
"moduleNameMapper": {
"[\\s\\S]*.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/tests/unit/__mocks__/fileMock.js",
"[\\s\\S]*.(css|less)$": "<rootDir>/tests/unit/__mocks__/styleMock.js",
"~/([a-zA-Z0-9/.\\-_]*)": "<rootDir>/src/$1"
@ernsheong
ernsheong / access-mac-localhost-from-parallels-desktop-ie-edge.md
Last active November 7, 2024 12:31
Accessing macOS localhost from Parallels Desktop IE or Edge

Access macOS localhost from IE or Edge within Parallels Desktop

This issue is so infuriating that I'm going to take some time to write about it.

  1. MOST IMPORTANT. Your local development server must be bound to IP address 0.0.0.0. Some do this by default, but many don't. You need to make sure that you run your local server with correct IP bindings. You may need to provide additional flags to your serve commands e.g. polymer serve --hostname domain.local, hugo serve --bind 0.0.0.0. If you use a named domain like domain.local, it has to be defined in /etc/hosts and pointing at 0.0.0.0.

  2. My Parallels setting is using Shared Network, nothing special there.

  3. Open macOS Terminal and type ifconfig. Look for the value under vnic0 > inet. It is typically 10.211.55.2.

@knibals
knibals / redirectExample.go
Created August 16, 2017 09:18 — forked from jaymecd/redirectExample.go
How to redirect HTTP to HTTPS with a golang webserver.
package main
import (
"net/http"
)
func redirect(w http.ResponseWriter, req *http.Request) {
http.Redirect(w, req,
"https://" + req.Host + req.URL.String(),
http.StatusMovedPermanently)
}
@brien-crean
brien-crean / twitter_oauth_user_context.js
Created July 14, 2017 18:22
Twitter 3 legged OAuth on AWS Lambda with NodeJS
const OAuth = require('oauth');
const Twit = require('twit');
const nconf = require('nconf');
// temp global var
var oAuthTokenSecret;
// load config file which contains twitter app tokens
nconf.file({ file: './config/twitter-share.json' }).env()
defmodule Image do
defstruct [:grid, :pixel_map]
end
defmodule RandomImageGenerator do
def create(width, bar_size, filename \\ "out.png") do
%Image{}
|> create_grid(width)
|> build_pixel_map(width, bar_size)