This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function calculate ($calories, $fiber, $fat) { | |
$points_from_fat = $fat / 12; | |
if ($fiber = 0) { | |
$fiber_caloric_reduction = 0; | |
} elseif ($fiber < 4) { | |
$fiber_caloric_reduction = $fiber * 10; | |
} elseif ($fiber > 4) { | |
$fiber_caloric_reduction = 40; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
require 'ruport' | |
rescue LoadError => err | |
warn "Couldn't load ruport gem: #{err}" | |
end | |
namespace :import do | |
desc 'Import tickets from CSV File' | |
task :csv => :environment do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
if [[ -n "$PS1" ]]; then | |
# don't put duplicate lines in the history. See bash(1) for more options | |
# ... or force ignoredups and ignorespace | |
HISTCONTROL=ignoredups:ignorespace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is in my .profile, you could also put it in your .bash_profile | |
feature_deliver() { | |
CURRENT=`git branch | grep '\*' | awk '{print $2}'` | |
feature_update | |
git checkout master | |
git merge --squash --no-commit ${CURRENT} | |
git commit | |
} | |
feature_update() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Stick this in config/initializers and restart your app to install | |
# Then you can log your deprecations to log/deprecations.log quickly and easily | |
# To log with this, just call: | |
# DeprecationLogger.notify('StringDescriptionOfMethod', DeprecationLogger.caller_method) | |
class DeprecationLogger < Logger | |
@logfile = File.open(Rails.root.join('log','deprecations.log'), 'a') | |
@logfile.sync = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (-f $request_filename) { | |
break; | |
} | |
try_files $uri $uri/ @wordpress; | |
index index.html, index.php; | |
} | |
location @wordpress { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~ :❯ time curl http://direct.indygeek.net/ > /dev/null | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 29504 0 29504 0 0 191k 0 --:--:-- --:--:-- --:--:-- 242k | |
real 0m0.159s | |
user 0m0.004s | |
sys 0m0.006s | |
~ :❯ time curl http://www.indygeek.net/ > /dev/null | |
% Total % Received % Xferd Average Speed Time Time Time Current |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
clear | |
function echo_newline { | |
echo -e "\n" | |
} | |
function pretty_echo { | |
echo_newline |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=border-radius-left($radius) | |
-moz-border-radius-topleft = $radius | |
-webkit-border-top-left-radius = $radius | |
-border-top-left-radius= $radius | |
-moz-border-radius-bottomleft = $radius | |
-webkit-border-bottom-left-radius = $radius | |
-border-bottom-left-radius= $radius | |
=border-radius-top($radius) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# Host Database | |
# | |
# localhost is used to configure the loopback interface | |
# when the system is booting. Do not change this entry. | |
## | |
127.0.0.1 localhost | |
255.255.255.255 broadcasthost | |
::1 localhost |
OlderNewer