Skip to content

Instantly share code, notes, and snippets.

@KonradLinkowski
KonradLinkowski / deploy.yml
Last active September 24, 2022 11:35
Github Pages auto-deploy
name: Build and Deploy
on:
push:
branches:
- main # change to your desired branch name
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
@zas
zas / install_intelr_graphic_linux_firmware.sh
Created September 9, 2016 00:06
Fix "W: Possible missing firmware /lib/firmware/i915/kbl_dmc_ver1.bin for module i915_bpo" (Ubuntu 16.04, kernel 4.4)
#!/bin/bash
cd
wget https://01.org/sites/default/files/downloads/intelr-graphics-linux/sklgucver61.tar.bz2 && \
tar xvjf sklgucver61.tar.bz2 && cd skl_guc_ver6_1/ && sudo ./install.sh
cd
wget https://01.org/sites/default/files/downloads/intelr-graphics-linux/kbldmcver101.tar.bz2 && \
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Nemitek
Nemitek / keras_prediction.py
Created October 22, 2015 04:11
Predicting sequences of vectors (regression) in Keras using RNN - LSTM (original by danielhnyk.cz) - fixed for Keras 0.2.0
import pandas as pd
from random import random
flow = (list(range(1,10,1)) + list(range(10,1,-1)))*1000
pdata = pd.DataFrame({"a":flow, "b":flow})
pdata.b = pdata.b.shift(9)
data = pdata.iloc[10:] * random() # some noise
import numpy as np
@wordpressandphpdeveloper
wordpressandphpdeveloper / Show All Tables in a MySQl Schema
Last active September 6, 2021 12:26
Php script to show all tables in a MySQL schema
<?php
//open database connection
$mysqli = new mysqli(<host>,<username>,<password>,<schema>);
//Display error message
if ($mysqli->connect_error) {
die('Error : ('. $mysqli->connect_errno .') '. $mysqli->connect_error);
}
$sql="SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = '<schema name>'";

Git Cheat Sheet

Commands

Getting Started

git init

or

@aneilbaboo
aneilbaboo / virtualenv.rvmrc
Last active October 20, 2015 18:58
This .rvmrc automatically creates/activates a python virtualenv
# save this file in the top level directory of your project as ".rvmrc"
# the virtualenv will be created/activated when you cd into the dir
if hash mkvirtualenv 2>/dev/null; then
virtualenv_name=$(basename `git rev-parse --show-toplevel`)
workon "$virtualenv_name"
if [ "$?" != "0" ]; then
mkvirtualenv "$virtualenv_name"
echo "\"pip install -r requirements.txt\" to install libraries"
fi
fi
@bsweger
bsweger / useful_pandas_snippets.md
Last active November 13, 2024 19:55
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)

import theano
from pylearn2.models import mlp
from pylearn2.training_algorithms import sgd
from pylearn2.termination_criteria import EpochCounter
from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix
import numpy as np
from random import randint
class XOR(DenseDesignMatrix):