Skip to content

Instantly share code, notes, and snippets.

View lixey's full-sized avatar

Lixey.Ko lixey

  • Space Сompany
  • Planet Earth
View GitHub Profile
@lixey
lixey / remote-typeahead.js
Created August 18, 2012 14:05 — forked from rn0/remote-typeahead.js
Remote data querying for Twitter Bootstrap 2.0 Typeahead without modifications
// Charles Lawrence - Feb 16, 2012. Free to use and modify. Please attribute back to @geuis if you find this useful
// Twitter Bootstrap Typeahead doesn't support remote data querying. This is an expected feature in the future. In the meantime, others have submitted patches to the core bootstrap component that allow it.
// The following will allow remote autocompletes *without* modifying any officially released core code.
// If others find ways to improve this, please share.
var autocomplete = $('#searchinput').typeahead()
.on('keyup', function(ev){
ev.stopPropagation();
ev.preventDefault();
<script type="text/javascript">
function loadIframelyEmbedJs() {
if (document.querySelectorAll('[data-iframely-url]').length === 0) return;
var iframely = window.iframely = window.iframely || {};
var widgets = iframely.widgets = iframely.widgets || {};
if (widgets.load) {
widgets.load();
} else {
var ifs = document.createElement('script'); ifs.type = 'text/javascript'; ifs.async = true;
ifs.src = ('https:' == document.location.protocol ? 'https:' : 'http:') + '//cdn.iframe.ly/embed.js';
@lixey
lixey / Keras_usage_example.ipynb
Created June 13, 2017 18:53 — forked from madrugado/Keras_usage_example.ipynb
Keras usage example, simple text classification
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lixey
lixey / gorm_model_gen.go
Created October 14, 2017 12:19 — forked from aliang228/gorm_model_gen.go
auto generate gorm models
package main
import (
"database/sql"
"fmt"
"os"
"strings"
_ "github.com/go-sql-driver/mysql"
)
@lixey
lixey / gist:79067ae39407a7ada02e08e8bb7d55e7
Created November 9, 2017 23:02 — forked from devisnotnull/installing_kubernetes_on_proxox.md
Installing Kubernetes on Proxox, Herzner

Installing Kubernetes on Proxox

For this example i shall be using a dedicated server from Hertzner.https://www.hetzner.de/en/. A shout out to hetzner if your looking for cheap and beefy dedicated hosting then these guys are your best bet.

Setting up the Hertzer server

This guide assumes your server has Debian 8 (Jessie installed)

Config when tested

@lixey
lixey / migrate.sh
Created November 14, 2017 17:27 — forked from pepijnblom/migrate.sh
Upgrade MAMP to Mysql 5.7
#!/bin/sh
wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.15-osx10.11-x86_64.tar.gz
tar xfvz mysql-5.7*
echo "stopping mamp"
sudo /Applications/MAMP/bin/stop.sh
sudo killall httpd mysqld
echo "creating backup"
@lixey
lixey / gist:69b4700f65d95e71c75c00774779e56c
Created April 26, 2018 20:47
Resizing a filesystem using qemu-img and fdisk

Occasionally we will deploy a virtual instance into our KVM infrastructure and realize after the fact that we need more local disk space available. This is the process we use to expand the disk image. This process assumes the following:

  • You're using legacy disk partitions. The process for LVM is similar and I will describe that in another post.
  • The partition you need to resize is the last partition on the disk.

This process will work with either a qcow2 or raw disk image. For

@lixey
lixey / droplet.sh
Created April 29, 2018 14:13 — forked from MartinAhrer/droplet.sh
Create DigitalOcean droplets
#!/usr/bin/env bash
SIZE=1gb
IMAGE=ubuntu-16-10-x64
REGION=fra1
TAG=droplet_sh
function createDroplet() {
: ${1?"Usage: createDroplet name sshkey-passphrase"}
: ${2?"Usage: createDroplet name sshkey-passphrase"}
Install s3fs on Mac OS X
1 - Install Homebrew - http://brew.sh/
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
2 - Use Homebrew to install s3fs + dependencies
brew install s3fs
3 - Do some custom stuff. I only used the first step from here -> https://gist.github.com/fukayatsu/3910097
sudo /bin/cp -rfX /usr/local/Cellar/fuse4x-kext/0.9.2/Library/Extensions/fuse4x.kext /Library/Extensions