This file contains 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
#Primary config file for Fish Shell | |
# replace things because fish are picky | |
#sighhhh... replaces eval "$(rbenv init -)" with eval "rbenv init -" > /dev/null 2>&1 | |
echo "Fishifying evals...." | |
cat ~/.shared_evals | sed -e 's/"$(/\\"/g' | sed -e 's/)"/\\" > \\/dev\\/null 2>\\&1/g' > ~/.config/fish/.fishified_shell_setup | |
echo "Getting ENV vars...." | |
cat ~/.shared_env >> ~/.config/fish/.fishified_shell_setup |
This file contains 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
[user] | |
name = David Ladowitz | |
email = [email protected] | |
[core] | |
quotepath = false | |
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
excludesfile = ~/.gitignore_global | |
editor = subl -n -w | |
[color] | |
ui = true |
This file contains 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
class String | |
def reverse_sentance | |
new_sentance = self | |
new_sentance = new_sentance.gsub(".", "") | |
new_sentance = new_sentance.split(" ") | |
new_sentance = new_sentance.reverse | |
new_sentance = new_sentance.join(" ") | |
new_sentance << "." |
This file contains 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
def numberOfPairs(a, k) | |
matching_pairs = [], outer_index = 0 | |
while outer_index < a.length | |
inner_index = outer_index + 1 | |
while inner_index < a.length | |
if a[outer_index] + a[inner_index] == k | |
matching_pairs = add_pair_to_array(matching_pairs, [a[outer_index], a[inner_index]]) | |
end |
This file has been truncated, but you can view the full file.
This file contains 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
<body ng-style="{'overflow': main.overflowView ? 'auto' : 'hidden'}" style="overflow: hidden;" class=""> | |
<!-- ngIf: !main.isLoaded && !main.overflowView && ('false' != 'true') --> | |
<!-- uiView: undefined --><ui-view name="miscView" class="ng-scope"></ui-view> | |
<div mobile-snap="" class="height_hundred" ng-show="main.isLoaded && !main.overflowView"> | |
<!-- ngIf: main.isSmallScreen --> | |
<snap-content snap-opt-disable="'right'" class="snap-content" style=""> | |
<div class="row mobile-zero-margins"> | |
<!-- uiView: undefined --><ui-view class="hidden-xs col-sm-1 ng-scope" style="width:60px" name="sidebarLeft" ng-hide="main.galleryView"><!-- ngIf: !main.isSmallScreen --><div ng-if="!main.isSmallScreen" class="ng-scope"> | |
<div class="menu menu__border munu--fixed"> |
This file contains 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
require 'json' | |
uri = URI.parse("https://api.admoda.com/v1/advertiser/stats/campaigns.csv?date=2015-03-11") | |
http = Net::HTTP.new(uri.host, uri.port) | |
http.use_ssl = true | |
http.verify_mode = OpenSSL::SSL::VERIFY_NONE # read into this | |
headers = {'Authorization' => 'Token a3446590e8920e90e857f20c3d24479c'} | |
response = http.get(uri.request_uri, headers) | |
p "----Response----" |
This file contains 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
class Person | |
attr_accessor :name, :age | |
def initialize | |
puts "name: #{name}" | |
puts "@name: #{@name}" | |
name = "David" | |
@name = "Tom" |
This file contains 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
require 'json' | |
require 'rest-client' | |
#get a big block of json | |
github_json = RestClient.get('https://api.github.com/users/rails/repos') | |
#format the json for ruby to read | |
ghub_json = JSON.load(github_json) | |
#loop over all the repos in the formatted json |
This file contains 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
require 'date' | |
require 'active_support/core_ext/integer/inflections' | |
class Payday | |
def self.get_next_payday(date) | |
payday = Payday.get_next_standard_payday(date) | |
payday = Payday.weekend_adjustment(payday) | |
"Payday will be " + payday.strftime("%a %b #{payday.day.ordinalize}") |
This file contains 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
require 'date' | |
require 'active_support/core_ext/integer/inflections' # Used for printing date as human text | |
require 'holidays' # Gives access to holiays | |
class Payday | |
def initialize(query_date) | |
@query_date = query_date | |
@next_payday = 'unknown' | |
end |
NewerOlder