Skip to content

Instantly share code, notes, and snippets.

Wojciech Franke enajski

Block or report user

Report or block enajski

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
@enajski
enajski / min-char-rnn.py
Created Nov 11, 2018 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
View min-char-rnn.py
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
View gist:fca56b7f8352a2332459
def taci
sample :loop_amen, start: 0.75, finish: 1, rate: 1.5
end
def cita
sample :loop_amen, start: 0.5, finish: 0.75, rate: 1.5
end
def puci
sample :loop_amen, start: 0.0, finish: 0.25, rate: 1.5
@enajski
enajski / Preferences.sublime-settings
Created Jun 17, 2014
Sublime Text 3 user config
View Preferences.sublime-settings
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Color Scheme - Default/Espresso Libre.tmTheme",
"font_face": "Menlo",
"font_size": 19,
"highlight_line": true,
"ignored_packages":
[
"Vintage",
@enajski
enajski / randomize_time_field
Created Mar 3, 2014
Update last_activity_date with random times
View randomize_time_field
def make_random_time
date1 = Time.new
date2 = Time.new - 50000000 # Beginning of time range
Time.at((date2.to_f - date1.to_f) * rand + date1.to_f).to_s
end
contacts = Contact.where(...)
contacts.each { |contact| contact.update_attribute(:last_activity_date, make_random_time) }
@enajski
enajski / base_cf_docs.md
Last active Sep 26, 2016
Documentation for Base CRM custom fields
View base_cf_docs.md
@enajski
enajski / csv-generator.rb
Created Aug 28, 2013
Faker CSV generator, courtesy of @yapee I think.
View csv-generator.rb
require 'faker'
modules = [Faker::Name, Faker::Company, Faker::Address, Faker::PhoneNumber, Faker::Internet]
puts modules.map { |x| x.methods(false).map { |y| "#{x.to_s.gsub("Faker::", "")} #{y}"} }.flatten.join(',')
data = (0...ARGV[0].to_i).map do
modules.map { |x| x.methods(false).map { |y| x.send(y) if x.method(y).arity < 1} }.flatten.join(',')
end
puts data.join("\n")
View gist:5365364
{
"bold_folder_labels": true,
"caret_style": "phase",
"font_size": 15.0,
"highlight_line": true,
"ignored_packages":
[
"Vintage"
],
"scroll_past_end": true,
View hooks.rb
require 'pry'
require 'calabash-cucumber/launch/simulator_helper'
require 'sim_launcher'
After( '@developing' ) do |scenario|
binding.pry if scenario.failed?
end
After do |scenario|
if scenario.failed?
@enajski
enajski / hooks.rb
Created Feb 11, 2013
Bind pry to inspect failing cucumber steps in development.
View hooks.rb
require 'pry'
After( '@developing' ) do |scenario|
binding.pry if scenario.failed?
end
You can’t perform that action at this time.