Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

David derdav3

🎯
Focusing
Block or report user

Report or block derdav3

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@derdav3
derdav3 / gist:c122df5d097504886fc1dd6f644f1892
Created Aug 30, 2019
Upgrade Ubuntu 19 sound via pulse_audio config
View gist:c122df5d097504886fc1dd6f644f1892
From here: https://medium.com/@gamunu/enable-high-quality-audio-on-linux-6f16f3fe7e1f
config in vim ~/.config/pulse/daemon.conf
default-sample-format = float32le
default-sample-rate = 48000
alternate-sample-rate = 44100
default-sample-channels = 2
default-channel-map = front-left,front-right
default-fragments = 2
View gist:35e4cf0f2b3e515441207b67522a6468
Verifying my Blockstack ID is secured with the address 1TDk1J7t7F2ardV5LRoSrMGEVHDJ1hnc8 https://explorer.blockstack.org/address/1TDk1J7t7F2ardV5LRoSrMGEVHDJ1hnc8
@derdav3
derdav3 / line_count.py
Created Apr 14, 2017
Fast way to get line count in python
View line_count.py
def wccount(filename):
out = subprocess.Popen(['wc', '-l', filename],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
).communicate()[0]
return int(out.lstrip().split()[0])
@derdav3
derdav3 / NN-for-loop.py
Last active Nov 8, 2019
For loop for creating neural net layers in tensorflow
View NN-for-loop.py
'''
I've found this little setup (https://pythonprogramming.net/community/262/TensorFlow%20For%20loop%20to%20set%20weights%20and%20biases/)
to create layers in a NN with a for loop. Unfortunately it doesn't really work - so here is a corrected version:
keep in mind, layer_config takes the form: [n_input, 200, 200, 200, 200, n_classes]
'''
def multilayer_perceptron(x, layer_config, name="neuralnet"):
'''
code from: https://pythonprogramming.net/community/262/TensorFlow%20For%20loop%20to%20set%20weights%20and%20biases/
'''
@derdav3
derdav3 / deep-net.py
Created Nov 30, 2016
Source Code to "Sentdex Deep Learning with Neural Networks and Tensorflow" part 4
View deep-net.py
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("/tmp/data/", one_hot=True)
n_nodes_hl1 = 500
n_nodes_hl2 = 500
n_nodes_hl3 = 500
@derdav3
derdav3 / AutoExpandingTextInput.js
Created Sep 17, 2016
AutoExpandingTextInput for React-Native
View AutoExpandingTextInput.js
import React, {Component} from 'react'
import {TextInput} from 'react-native'
export default class AutoExpandingTextInput extends Component {
state: any;
constructor(props) {
super(props);
this.state = {text: '',tags:[], height: 0};
}
render() {
You can’t perform that action at this time.