Skip to content

Instantly share code, notes, and snippets.

View basicavisual's full-sized avatar
🦝
raccoon

Ali G basicavisual

🦝
raccoon
View GitHub Profile
PS1="[\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\W\[\033[00m\]]\$($( cat ~/.local/git-ps1.sh ))> "
h = {"amount"=>"700", "dueDate"=>"2018-07-31"}
h.map{|a| a["amount"].to_f }
TypeError Exception: no implicit conversion of String into Integer
from pyquery import PyQuery as pq
file = open('i44013001o2003.xlsx', 'r', errors='ignore').read()
doc = pq(file)
list = [ table.text() for table in doc('table').items() ]
data = [list[2], list[4], list[6], list[8]]
countries = []
for i in range(len(data)):
lenghts = data[i].split('\n')
countries.append(int((len(lenghts) - 14 ) / 13))
data = [
"44013001",
"44042099",
"44071001",
"44071002",
"44072101",
"44072102",
"44072199",
"44072201",
"44072299",
<!-- Navigation -->
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">Buscándonos</a>
@basicavisual
basicavisual / application.html.erb
Created March 16, 2018 00:14 — forked from suryart/application.html.erb
Rails 4 flash messages using Twitter Bootstrap(bootstrap-sass: https://github.com/thomas-mcdonald/bootstrap-sass). An improved version of https://gist.github.com/roberto/3344628
// layout file
<body>
<div class="container">
<%= flash_messages %>
<%= yield %>
</div><!-- /container -->
</body>
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do
@basicavisual
basicavisual / time.sh
Created March 1, 2018 22:46
time script
#!/bin/bash
PATH=/opt/someApp/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
t=`date +"%T"`
gtts-cli $t -l 'es' | mpg123 -
@basicavisual
basicavisual / task_controller_relevant parts
Created January 15, 2018 06:09
can't pass instance variables from controller to view
class TasksController < ApplicationController
before_action :set_project
before_action :set_task, except: [:index, :new, :create]
def index
@tasks = @project.tasks.all
@completed = @tasks.completed
end
private
@basicavisual
basicavisual / reset.sass
Created November 20, 2017 01:48 — forked from trey/reset.sass
Eric Meyer's reset.css in Sass. Originally by @postpostmodern.
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain) */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,