Skip to content

Instantly share code, notes, and snippets.

View viniciusCamargo's full-sized avatar
🧙‍♂️

Vinicius de Sousa Camargo viniciusCamargo

🧙‍♂️
View GitHub Profile
@viniciusCamargo
viniciusCamargo / MySQL_Cheat_Sheet.sql
Last active June 29, 2016 18:09
MySQL cheat sheet
/*
* mysql -u root -p < query_test.sql
* senha geralmente é admin
*/
CREATE DATABASE name_of_the_database;
SHOW DATABASES;
DESCRIBE name_of_the_database;
USE name_of_the_database;
SHOW tables;
@viniciusCamargo
viniciusCamargo / .bashrc
Last active October 13, 2016 14:50
my terminal style
# (...)
PS1='\[\033[01;32m\]\u@\h \[\033[01;34m\]\w \n \[\033[01;35m\]λ\[\033[01;00m\] '
# \u: Display the current username
# \h: Display the hostname
# \w : the current working directory, with $HOME abbreviated with a tilde
# \n : newline
# \[\033[01;35m\]: a color
import React, { Component } from 'react'
// import Comment from './Comment'
import axios from 'axios'
class CommentBox extends React.Component {
constructor() {
super();
this.state = {
showComments: false,
@viniciusCamargo
viniciusCamargo / installing-tar-files.md
Last active November 16, 2016 12:59
How to install .tar files in LInux

How to install .tar files in LInux

  1. Extract files
  2. Move the folder to /opt
  3. Make a symbolic link in /usr/bin with sudo ln -s /opt/name-of-the-program/program-file /usr/bin

Use menulibre to add the entry to the menu.

@viniciusCamargo
viniciusCamargo / bootstrap.grid.css
Created November 24, 2016 18:33
Bootstrap Grid
/*!
* Bootstrap v3.3.7 (http://getbootstrap.com)
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*!
* Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=86d371b91974c4a471afdfcaa1b4a83f)
* Config saved to config.json and https://gist.github.com/86d371b91974c4a471afdfcaa1b4a83f
*/
@viniciusCamargo
viniciusCamargo / blueprint.css
Last active November 24, 2016 18:36
My version of Blueprint CSS framework that blends well Bootrap Grids (it is basically the style of Blueprint)
/* -----------------------------------------------------------------------
Blueprint CSS Framework 1.0
http://blueprintcss.org
* Copyright (c) 2007-Present. See LICENSE for more info.
* See README for instructions on how to use Blueprint.
* For credits and origins, see AUTHORS.
* This is a compressed file. See the sources in the 'src' directory.
@viniciusCamargo
viniciusCamargo / blueprint&bootstrap.html
Created November 24, 2016 18:55
HTML Mockup to use with my build of Blueprint + Bootstrap
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Document</title>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/blueprint.css">
@viniciusCamargo
viniciusCamargo / lineReader.js
Last active February 12, 2017 01:41
Read line and execute a child process (curl) with Node
const lineReader = require('readline').createInterface({
input: require('fs').createReadStream(process.argv[2])
})
lineReader.on('line', (line) => {
console.log('Reading ', line)
require('child_process').exec('curl -O ' + line, (err, stdout, stderr) => {
if (err)
throw err
@viniciusCamargo
viniciusCamargo / changeFileExtension.js
Last active February 12, 2017 03:35
Change file extension on the current directory from PHP to HTML
const fs = require('fs')
const cwd = process.cwd()
fs.readdir(cwd, 'utf8', (err, files) => {
if (err)
throw err
files.map(f => fs.rename(f, f.replace('php', 'html'), (err, file) => {
if (err)
throw err
const fs = require('fs')
const cwd = process.cwd()
const contentToDelete = ` <link rel="SHORTCUT ICON" href="https://37signals.com/images/37.ico" />`
const file = 'ch01_About_37signals - Copy.html'
const replaceContent = (file, from, to) => {
fs.readFile(file, 'utf8', (err, data) => {
if (err)