Skip to content

Instantly share code, notes, and snippets.

ph3nx ph3nx

Block or report user

Report or block ph3nx

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
ph3nx / index.html
Created Jan 30, 2015
Zeit [add your bin description] // source
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Zeit<style id="jsbin-css">
body {
font: 16px helvetica, arial, sans-serif;
background-color: #eee;
margin: 10px;
ph3nx / cardfan.css
Last active Aug 29, 2015
CardFan for TSS website.
View cardfan.css
body {
background-color: #fff;
font-size: 16px;
font-family: helvetica;
.jwlogo {
display: none;
ph3nx / jwplayer.html
Created Feb 26, 2014
This is how you setup the jwplayer with a self-hosted video file. The official documentation:
View jwplayer.html
<!-- JW Player Library -->
<script src=""></script>
<!-- div for the player -->
<div id='playerKXSDPIwKERSv'></div>
<!-- Script to display video file in the player div -->
<script type='text/javascript'>
// URL to the video file
ph3nx /
Created Feb 8, 2014
Shell script to generate an rails app with postgres database in osx mavericks.
case "$1" in
"n" )
if [ -z $2 ]
echo "Specify an app name"
if [ -d ~/rails/$2 ]
echo "App '$2' exists already"
ph3nx /
Last active Aug 29, 2015
Disable Dashboard in osx mavericks.
# Disable Dashboard
defaults write mcx-disabled -boolean true
killall Dashboard
# Enable Dashboard
defaults write mcx-disabled -boolean false
killall Dashboard
ph3nx / start_chrome.bat
Last active Aug 29, 2015
Batchfile to copy updated project files in the webroot and open the website in chrome.
View start_chrome.bat
xcopy /s /Y C:\Users\Pascal\drive\Projects\karteikarten C:\xampp\htdocs\karteikarten
chrome "http://localhost/karteikarten"
ph3nx / round_down_proc.rb
Created Jan 21, 2014
Ruby example that explains the usage of Proc's.
View round_down_proc.rb
floats = [1.2, 3.45, 0.91, 7.727, 11.42, 482.911]
# Write your code below this line!
round_down = { |f| f.floor }
# Write your code above this line!
ints = floats.collect(&round_down)
ph3nx / case.rb
Created Jan 20, 2014
Some examples for the case method in Ruby.
View case.rb
case var
when 1
puts 1
when 2
puts 2
puts 'none'
case var
ph3nx / benchmark_string_vs_symbol.rb
Created Jan 20, 2014
Simple Ruby benchmark to benchmark strings and symbols.
View benchmark_string_vs_symbol.rb
require 'benchmark'
string_AZ = Hash[("a".."z")]
symbol_AZ = Hash[(:a..:z)]
string_time = Benchmark.realtime do
100_000.times { string_AZ["r"] }
symbol_time = Benchmark.realtime do
ph3nx / alphabetize.rb
Last active Jun 28, 2018
The Ruby method "alphabetize" sorts an array in alphabetical order. If you wish put true as second argument to sort in descending order.
View alphabetize.rb
def alphabetize arr, rev=false
if rev
puts alphabetize ["b","e","a"], true
# => ["e","b","a"]
You can’t perform that action at this time.