Skip to content

Instantly share code, notes, and snippets.

View gollum23's full-sized avatar
:octocat:
Learning all days

Diego Forero gollum23

:octocat:
Learning all days
View GitHub Profile
@gollum23
gollum23 / postgres_queries_and_commands.sql
Created April 14, 2020 10:37 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'

Keybase proof

I hereby claim:

  • I am gollum23 on github.
  • I am gollum23 (https://keybase.io/gollum23) on keybase.
  • I have a public key whose fingerprint is 6E44 748E F5AE A872 790C B681 6D36 8A47 4344 B8CC

To claim this, I am signing this object:

@gollum23
gollum23 / package.json
Created November 12, 2018 15:27 — forked from mburakerman/package.json
Webpack 4 config.js (Stylus to CSS and Babel) 👌 The Simplest Usage 👌
{
"name": "webpack-stylus",
"version": "1.0.0",
"scripts": {
"start": "webpack-dev-server --open --mode development",
"build": "webpack -p"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.4",
@gollum23
gollum23 / exercise.tour.go
Created August 8, 2017 02:53 — forked from zyxar/exercise.tour.go
tour.golang exercise solutions
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)
@gollum23
gollum23 / gist:a0a1efed8547c06285fa0f4310a83cf4
Created July 19, 2017 11:12 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@gollum23
gollum23 / index.html
Created January 23, 2017 01:44 — forked from CodeMyUI/index.html
Pokemon Slider
<div class="slider__warpper">
<div class="flex__container flex--pikachu flex--active" data-slide="1">
<div class="flex__item flex__item--left">
<div class="flex__content">
<p class="text--sub">Pokemon Gen I</p>
<h1 class="text--big">Pikachu</h1>
<p class="text--normal">Pikachu is an Electric-type Pokémon introduced in Generation I. Pikachu are small, chubby, and incredibly cute mouse-like Pokémon. They are almost completely covered by yellow fur.</p>
</div>
<p class="text__background">Pikachu</p>
</div>
@gollum23
gollum23 / jupyter_shortcuts.md
Created November 8, 2016 22:19 — forked from kidpixo/jupyter_shortcuts.md
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

Toc

Keyboard shortcuts

The IPython Notebook has two different keyboard input modes. Edit mode allows you to type code/text into a cell and is indicated by a green cell border. Command mode binds the keyboard to notebook level actions and is indicated by a grey cell border.

MacOS modifier keys:

  • ⌘ : Command
@gollum23
gollum23 / .tmux.conf
Last active November 7, 2018 21:07
Tmux config
# set scroll history to 10,000 lines
set-option -g history-limit 10000
# modern encoding and colors
#set -g utf8 on set-window-option -g utf8 on
#set -g default-terminal screen-255color
# enable vi-like copy/paste
#set-window-option -g mode-keys vi
def proyecto_nuevo(request):
if request.method == 'POST':
formProyecto = ProyectForm(request.POST)
formImage = ImageForm(request.POST, request.FILES)
if formProyecto.is_valid() and formImage.is_valid():\
proyecto = formProyecto.save()
imagen = formImage.save(commit=False)
imagen.proyecto = proyecto.id
image.save()
return HttpResponseRedirect('url')
@gollum23
gollum23 / main.cpp
Created March 7, 2016 22:43
Código actividad 2
// Inclusión de libreria standard de entrada y salida
#include <iostream>
/* Inclusión de libreria de utilidades generales como, administración dinamica de memoria,
generación de números aleatorios entre otras */
#include <cstdlib>
// Nombre de espacio para identificar el alcance a las funciones y variables
using namespace std;
// Declaración de la estructura de datos