Skip to content

Instantly share code, notes, and snippets.

@miku
miku / README.md
Created March 4, 2019 19:30 — forked from mikecharles/README.md
Deploy a Python application using Ansible and the Ansistrano role

To deploy your app, you'll need to install Ansible and the Ansistrano deploy and rollback Ansible Galaxy roles.

Then create a directory in your app (eg. named ansible) and put these files in there. You should only need to modify the top few variables in vars.yml to get the deployment working for your app.

To do the deployment, use a command like this:

ansible-playbook --limit ansible/deploy.yml

import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
from pandas_datareader import data as web
from datetime import datetime as dt
app = dash.Dash('Hello World')
@miku
miku / README.md
Created January 31, 2019 16:57 — forked from LaurensRietveld/README.md
#YASGUI: Creating a YASGUI page

To include YASGUI, simply take this HTML file. If you'd like to remove the endpoint selector widget, uncommment the CSS part in the head of the HTML

@miku
miku / irssi_notify.pl
Created January 3, 2019 07:51 — forked from baris/irssi_notify.pl
irssi notify.pl using notify-send (instead of dbus-send) on ubuntu.
##
## Put me in ~/.irssi/scripts, and then execute the following in irssi:
##
## /load perl
## /script load notify
##
use strict;
use Irssi;
use vars qw($VERSION %IRSSI);
@miku
miku / arch-linux-install
Created November 21, 2018 10:33 — forked from binaerbaum/arch-linux-install
Minimal instructions for installing arch linux on an UEFI NVMe system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swiss-french keymap
@miku
miku / The Technical Interview Cheat Sheet.md
Created October 28, 2018 20:51 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@miku
miku / go-os-arch.md
Created October 28, 2018 20:21 — forked from asukakenji/0-go-os-arch.md
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.8.3 darwin/amd64.

A list of valid GOOS values

(Bold = supported by go out of the box, ie. without the help of a C compiler, etc.)

  • android
  • darwin
@miku
miku / hosts
Created August 9, 2018 09:10
Hosts File to Block Facebook from my Machine
127.0.0.1 api.ak.facebook.com
127.0.0.1 api.connect.facebook.com
127.0.0.1 api.facebook.com
127.0.0.1 app.facebook.com
127.0.0.1 apps.facebook.com
127.0.0.1 ar-ar.facebook.com
127.0.0.1 badge.facebook.com
127.0.0.1 blog.facebook.com
127.0.0.1 connect.facebook.com
127.0.0.1 connect.facebook.net
#!/bin/bash
# requires imagemagick and ffmpeg (tested with latest versions)
# make sure you set an INFILE variableo first
INFILE=$1
# get GIF info
video=$(ffmpeg -i "$INFILE" 2>&1 /dev/null | grep "Video:");
@miku
miku / SolrQuerySyntaxPrimer.md
Created May 9, 2018 12:57 — forked from mankyKitty/SolrQuerySyntaxPrimer.md
The documentation around the basics of the Solr query syntax is terrible, this is an attempt to alleviate the doc-shock associated with trying to learn some fundamentals.

Solr Query Syntax Basics

This is a super basic beginners guide to Solr Lucene query syntax. We're going to cover running a straightforward query, as well as some of the more useful functionality such as filtering and creating facets. We'll point out some things you can't do and generally give you enough instruction so that you can get yourself into trouble.

For testing you need a REST client capable of sending requests to your Solr instance. Either RESTClient for Firefox or Postman for Chrome are good choices.

Misc

Request Specific Fields

To specify a list of fields to return instead of the default Solr response use fl and provide a comma delimited list of fields: