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
range_array = *(1..20) | |
@nums = range_array.map{|n| Hash[n, n] }.reduce({}, :merge) | |
#=> {1=>1, 2=>2, 3=>3, 4=>4, 5=>5, 6=>6, 7=>7, 8=>8, 9=>9, 10=>10, 11=>11, 12=>12, 13=>13, 14=>14, 15=>15, 16=>16, 17=>17, 18=>18, 19=>19, 20=>20} |
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
[crit] 12429#0: *27 stat() "/home/user/soWed/public/" failed (13: Permission denied), client: 215.21.75.35, server: mamamia.xyz, request: "GET / HTTP/1.1", host: "mamamia.xyz" |
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
CREATE FUNCTION ys_payments (@ent int,@year int,@q int) | |
RETURNS TABLE | |
AS | |
RETURN | |
... | |
where year(reportingPeriod) = @year | |
and | |
case | |
when @q = 1 then month(reportingPeriod) between @q and @q + 2 | |
when @q = 2 then month(reportingPeriod) between @q + 2 and @q + 4 |
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
agent = Mechanize.new | |
agent.get("http://play.google.com/music/publish/") | |
form = agent.page.forms.first | |
/* | |
=> #<Mechanize::Form | |
{name nil} | |
{method "POST"} | |
{action "https://accounts.google.com/AccountLoginInfo"} | |
{fields | |
[hidden:0x605897a type: hidden name: Page value: PasswordSeparationSignIn] |
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
select | |
r.name as release,a.name as artist,r.version,l.name as label,count(distinct r.upc) as upcCount,concat(distinct r.upc) as upcs | |
from releases r | |
join artists a on a.artistid = r.artistid | |
join labels l on l.labelid = r.labelid | |
where l.name = 'foo' | |
group by r.name, a.name,l.name,r.version,upcs | |
having count(distinct r.upc) > 1 | |
order by upcCount desc |
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 CatalogTemplatesController < ApplicationController | |
. | |
. | |
. | |
def parse | |
require 'roo' | |
require 'roo-xls' | |
workbook = Roo::Excel.new("/home/123.xls") | |
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
#!/bin/bash | |
datafile=$1 | |
ctr=0; | |
while read line | |
do | |
# counter to keep track of line number | |
ctr=$((ctr + 1)) |
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
So I have no code, because i have no idea how to do this... | |
I am looking for a link to start reading... | |
Taking this sample row: | |
original: | |
--bRP68Ey4M,Natalie Imbruglia Torn,16,0,USD,"Torn,,Torn,","GB1109700440,,GBARL0400487,",,",emipub|UMPG,,emipub|UMPG","Natalie Imbruglia,,Various," | |
desired output: | |
=--bRP68Ey4M,Natalie Imbruglia Torn,16,0,USD,Torn,GB1109700440,,,Natalie Imbruglia | |
=--bRP68Ey4M,Natalie Imbruglia Torn,16,0,USD,,,,emipub|UMPG, | |
=--bRP68Ey4M,Natalie Imbruglia Torn,16,0,USD,Torn,GBARL0400487,,,Various |
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
<!DOCTYPE html > | |
<html lang="en" | |
ng-app="minmax" > | |
<head > | |
<title >Controllers</title > | |
<link href="../libs/bootstrap/bootstrap.min.css" | |
rel="stylesheet" > | |
<link href="main.css" | |
rel="stylesheet" > | |
</head > |
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
# This file should contain all the record creation needed to seed the database with its default values. | |
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). | |
# | |
# Examples: | |
# | |
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) | |
# Mayor.create(name: 'Emanuel', city: cities.first) | |
require 'roo' | |
def fetch_excel_data |
NewerOlder