dropdb pulse_dev
dropdb pulse_test
rake db:create
rm db/migrate/*
rails g model Service
require 'nokogiri' | |
class LogfileParser | |
XPATH_QUERY = "Response[@ID][@Version='2.0']" | |
SAML_XMLNS = 'urn:oasis:names:tc:SAML:2.0:assertion' | |
SAMLP_XMLNS = 'urn:oasis:names:tc:SAML:2.0:protocol' | |
def initialize(path, email) | |
raise ArgumentError unless File.exists?(path) |
require 'open-uri' | |
require 'json' | |
class Profile | |
DATA = JSON.parse('<data object>') | |
end | |
Profile::DATA.each do |profile| | |
location = profile.last.sub('https', 'http') | |
name = profile.first |
# find non UTF8 encoded files | |
find . -type 'f' -exec file {} \; | grep 'ASCII' | |
# find | |
grep -rnw 'app/views/bids' -e "pandoc" | |
# fix | |
find '20' -type f -exec gsed -i.bak "s/test/\/media\/Telecom Italia/g" {} \; | |
find '21' -type f -exec gsed -i.bak "s/Telecom Italia (AWS)\/pandoc-output\/media/\/media\/Telecom Italia (AWS)/g" {} \; | |
find 'app/views/bids/8' -type f -exec gsed -i.bak "s/Dom-Daniel \/media\/LLC/\/media\/Dom-Daniel LLC/g" {} \; |
def find_aaaab(s) | |
counter_a = 0 | |
s.split("").each do |c| | |
if c == 'a' | |
counter_a += 1 | |
elsif (c == 'b' && counter_a >= 4) | |
return true | |
else | |
counter_a = 0 | |
end |
// 1. Visit https://geant.slack.com/team | |
// 2. Paste this code in your console | |
// 3. In console: copy(data) | |
var store = {} | |
$('div.member_item').each(function(i, e) { | |
var el = $(this); | |
var userimage = el.find('a.member_image').data('original'); | |
var email = el.find('div.expanded_member_details a[title~="Email"]')[0]; | |
if (email !== undefined && userimage.indexOf("?") === -1) { |
#!/bin/bash | |
# | |
# generate a Markdown version of a word document. Goes in separate folder, since | |
# images are extracted and converted as well (separate folder avoids naming clashes). | |
# | |
# REQUIREMENTS: pandoc | |
# | |
# | |
# with pandoc | |
# --extract-media=[media folder] |
dropdb pulse_dev
dropdb pulse_test
rake db:create
rm db/migrate/*
rails g model Service