Skip to content

Instantly share code, notes, and snippets.

View Oxyrus's full-sized avatar
🥟

Andrés Pérez Oxyrus

🥟
View GitHub Profile
<%= simple_form_for @article do |f| %>
<%= f.input :title, label: "Title of the article" %>
<%= f.text_area :body, :input_html => { :class => "tinymce" }, :rows => 20, :cols => 60 %>
<%= f.input :description, label: "Short description of the article" %>
<%= f.input :header, label: "Header image" %>
<%= f.button :submit %>
<%= tinymce %>
<%end%>
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES * * */
var disqus_shortname = 'oxyrus';
var disqus_identifier = '2';
var disqus_title = 'Whatever';
var disqus_url = 'http://localhost:3000/posts/2'
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
https://gist.github.com/somebox/1082608
@Oxyrus
Oxyrus / gh-like.css
Last active September 13, 2015 17:36 — forked from somebox/gh-like.css
github markdown css+script with syntax highlighting. Works with http://markedapp.com
/*
Some simple Github-like styles, with syntax highlighting CSS via Pygments.
*/
body{
font-family: helvetica, arial, freesans, clean, sans-serif;
color: #333;
background-color: #fff;
border: none;
line-height: 1.5;
margin: 2em 3em;
@Oxyrus
Oxyrus / App.jsx
Last active December 4, 2016 22:48
Conexión desde React a GraphQL, la extensión real de los archivos es .js
import React, { Component, PropTypes } from 'react';
import { graphql } from 'react-apollo';
import gql from 'graphql-tag';
class App extends Component {
render() {
if (!this.props.data.posts) {
return null;
}
return (
@Oxyrus
Oxyrus / Login.js
Created January 29, 2017 01:40 — forked from bruce/Login.js
React + Redux + localStorage Login example
// components/Login/Login.js
class Login extends Component {
// ...
handleSubmit(evt) {
evt.preventDefault();
this.props.mutate(this.state)
.then(({ data }) => {
@Oxyrus
Oxyrus / GoMgoSample-1.go
Created March 3, 2017 15:55 — forked from ardan-bkennedy/GoMgoSample-1.go
Sample Go and MGO example
type (
// BuoyCondition contains information for an individual station.
BuoyCondition struct {
WindSpeed float64 `bson:"wind_speed_milehour"`
WindDirection int `bson:"wind_direction_degnorth"`
WindGust float64 `bson:"gust_wind_speed_milehour"`
}
// BuoyLocation contains the buoy's location.
BuoyLocation struct {
@Oxyrus
Oxyrus / cache.go
Created July 22, 2017 17:07 — forked from zemirco/cache.go
golang database layer with cache
type CacheInterface interface {
Get(key string) ([]byte, error)
Set(key string, value interface{}) error
}
// Cache implements CacheInterface.
type Cache struct {
// wrap redis pool connection
// or whatever you need
}
@Oxyrus
Oxyrus / ariake.vim
Created October 10, 2017 02:09 — forked from eritbh/ariake.vim
" Vim color file
" Converted from Textmate theme Ariake using Coloration v0.4.0 (http://github.com/sickill/coloration)
set background=dark
highlight clear
if exists("syntax_on")
syntax reset
endif
@Oxyrus
Oxyrus / submodules.md
Created November 6, 2017 00:14 — forked from manasthakur/submodules.md
Using git submodules to version-control Vim plugins

Using git-submodules to version-control Vim plugins

If you work across many computers (and even otherwise!), it's a good idea to keep a copy of your setup on the cloud, preferably in a git repository, and clone it on another machine when you need. Thus, you should keep the .vim directory along with your .vimrc version-controlled.

But when you have plugins installed inside .vim/bundle (if you use pathogen), or inside .vim/pack (if you use Vim 8's packages), keeping a copy where you want to be able to update the plugins (individual git repositories), as well as your vim-configuration as a whole, requires you to use git submodules.

Creating the repository

Initialize a git repository inside your .vim directory, add everything (including the vimrc), commit and push to a GitHub/BitBucket/GitLab repository:

cd ~/.vim