Skip to content

Instantly share code, notes, and snippets.

View denysonique's full-sized avatar

Dennis Prochniak denysonique

View GitHub Profile
var request = require('request');
var cheerio = require('cheerio');
var pages, channel, link, url, page, week, songCount, list;
getMusic = function (link, pages, callfuck) {
console.log('Initializing Music retrieval...');
for (pageX = 0; pageX <= pages; pageX++) {
url = link + pageX;
console.log(url, pageX);
var request = require('request');
var cheerio = require('cheerio');
var pages, channel, link, url, page, week, songCount, list;
getMusic = function (link, pages, callfuck) {
console.log('Initializing Music retrieval...');
for (pageX = 0; pageX <= pages; pageX++) {
url = link + pageX;
console.log(url, pageX);
getMusic = function (link, pages) {
console.log('Initializing Music retrieval...');
for (pageX = 0; pageX <= pages; pageX++) {
url = link + pageX;
getPage(pageX);
};
};
function getPage (pageX) {
console.log('enter get page');
if ! $(psql template1 -c 'SHOW SERVER_ENCODING' | grep -q UTF8); then
psql postgres -c "update pg_database set datallowconn = TRUE where datname = 'template0';"
psql template0 -c "update pg_database set datistemplate = FALSE where datname = 'template1';"
psql template0 -c "drop database template1;"
psql template0 -c "create database template1 with template = template0 encoding = 'UTF8';"
psql template0 -c "update pg_database set datistemplate = TRUE where datname = 'template1';"
psql template1 -c "update pg_database set datallowconn = FALSE where datname = 'template0';"
fi
@denysonique
denysonique / 2 - nap_export.rb
Created June 7, 2012 09:08
EXPORTS SQLITE DATA INTO POSTGRESQL
#!/usr/bin/env ruby
# 1283314500 EXPORTS NET-A-PORTER LIVE DATA INTO POSTGRESQL
require "logger"
require "sequel"
#require "pgpass"
require "fileutils"
module NAP
@denysonique
denysonique / gist:2715518
Created May 17, 2012 01:35 — forked from mstarkman/gist:1431342
Unable to access connect-assets jsCompilers
assets = require 'connect-assets'
eco = require 'eco'
assets.jsCompilers.eco =
eco:
match: /\.eco$/
compileSync: (sourcePath, source) ->
eco.compile source
@denysonique
denysonique / gist:1489887
Created December 17, 2011 10:26 — forked from mauriciofierrom/gist:1489885
ujs problem
def create
@cart = current_cart
product = Product.find(params[:product_id])
@line_item = @cart.add_product(product.id)
respond_to do |format|
if @line_item.save
format.html { redirect_to(store_url)}
format.js { @current_item = @line_item }
format.xml { render :xml => @line_item, :status => :created, :location => @line_item }
//wyświetla wszystkie argumenty, w nawiasie podając ich długość
int dl_napisu(char n[]) {
int i = 0;
while(n[i] != 0)
i++;
return i;
}
@denysonique
denysonique / gist:1099325
Created July 22, 2011 12:10 — forked from nickws/gist:1099324
database.yml
development:
adapter: postgresql
database: emotio-dev
pool: 5
timeout: 5000
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
/*
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*= require_tree .
*= require layout
*/