Skip to content

Instantly share code, notes, and snippets.

View Pirolf's full-sized avatar

Yucheng Tu Pirolf

  • Aperture Science
  • City 17
View GitHub Profile
@Pirolf
Pirolf / imbalanced_dataset_lr_comparison.py
Created March 26, 2018 01:19 — forked from rnowling/imbalanced_dataset_lr_comparison.py
Imbalanced Dataset Logistic Regression Model Comparison
"""
Script for comparing Logistic Regression and associated evaluation metrics on the imbalanced Media 6 Degrees dataset from the Doing Data Science book. You'll need to download a copy of the dataset from the GitHub repo: https://github.com/oreillymedia/doing_data_science .
Copyright 2016 Ronald J. Nowling
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
#! /bin/bash
# streaming on Ubuntu via ffmpeg.
# see http://ubuntuguide.org/wiki/Screencasts for full documentation
# see http://www.thegameengine.org/miscellaneous/streaming-twitch-tv-ubuntu/
# for instructions on how to use this gist
if [ ! -f ~/.twitch_key ]; then
echo "Error: Could not find file: ~/.twitch_key"
echo "Please create this file and copy past your stream key into it. Open this script for more details."
@Pirolf
Pirolf / 0.setup.sh
Created February 18, 2016 05:11 — forked from ceteri/0.setup.sh
Spark Streaming demo
# using four part files to construct "minitweet"
cat rawtweets/part-0000[1-3] > minitweets
# change log4j properties to WARN to reduce noise during demo
mv conf/log4j.properties.template conf/log4j.properties
vim conf/log4j.properties # Change to WARN
# launch Spark shell REPL
./bin/spark-shell
@Pirolf
Pirolf / bootstrap_glyphs_in_rails.md
Created November 9, 2015 22:46 — forked from iamatypeofwalrus/bootstrap_glyphs_in_rails.md
Get Glyphicons up and running in Rails 3.2 without using a gem

Getting Glyphicons from Bootstrap 3.0 in Rails: the easy way

What

Bootstrap 3.0 gives you access to the awesome icon set icon set by these dudes but it's not obvious for a Rails newbie like myself to get it all working together nicely

How

  1. Download the bootstrap-glyphicons.css from here. Save that file to RAILS_ROOT/vendor/assets/stylesheet/bootstrap-glyphicons.css
  2. Save all the font files in /dist/fonts from the Bootstrap 3.0 download to a new folder in your Rails app RAILS_ROOT/vendor/assets/fonts
  3. Add this folder to the asset pipeline by appending config.assets.paths << Rails.root.join("vendor","assets", "fonts") to application.rb after the line that has class Application < Rails::Application.
  4. In bootstrap-glyphicons.css modify the the `url
@Pirolf
Pirolf / secret_key_base
Created September 24, 2015 14:29 — forked from pablosalgadom/secret_key_base
app error: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml` (RuntimeError)
So i was using Rails 4.1 with Unicorn v4.8.2 and when i tried to deploy my app it doesn't start properly and into the unicorn.log file i found this error message:
"app error: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml` (RuntimeError)"
After a little research i found that Rails 4.1 change the way to manage the secret_key, so if we read the secrets.yml file located at exampleRailsProject/config/secrets.yml (you need to replace "exampleRailsProject" for your project name) you will find something like this:
# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@Pirolf
Pirolf / .bash_profile
Last active August 29, 2015 14:23 — forked from zeroeth/.bash_profile
# Local executables
export PATH=$HOME/bin:/usr/local/bin:$PATH
# NPM executables (For folder local, and a global prefix of "~/npm")
export PATH=./node_modules/.bin:$HOME/npm/bin:$PATH
# Android SDK
export ANDROID_HOME=~/bin/android-sdk
export PATH=$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH
@Pirolf
Pirolf / polygonal.md
Last active August 29, 2015 14:17 — forked from zeroeth/polygonal.md

Different Strokes for Different Folks

An incomplete list of different modeling tools and techniques for interesting art.

@Pirolf
Pirolf / musical.md
Last active August 29, 2015 14:16 — forked from zeroeth/musical.md