Skip to content

Instantly share code, notes, and snippets.

View DouglasdeMoura's full-sized avatar

Douglas Moura DouglasdeMoura

View GitHub Profile
.site-content {
background: $color__background-site-content;
padding: $padding__site-content;
}
.site-content,
.featured-content {
max-width: $size__site-content;
margin: auto;
}
@DouglasdeMoura
DouglasdeMoura / Form.vb
Created July 2, 2015 14:03
Create a button on Excel spreasheets with VBA
' Usage:
' Call CreateButton("Example", "A1", "name_of_the_macro")
Sub CreateButton(name, rng, theMacro)
With ActiveSheet
Debug.Print .range(rng).Left
Debug.Print .range(rng).Top
.Buttons.Add(.range(rng).Left, .range(rng).Top, .range(rng).Width, .range(rng).height).Select
With Selection
.Characters.Text = name
@DouglasdeMoura
DouglasdeMoura / export.vb
Last active August 29, 2015 14:24
Export a range from a Excel spreadsheet to a new file
Sub ExportData(rng, fileFormat as Integer = 51)
Dim irow As Integer
Dim rngArr() as String
fileSaveName = Application.GetSaveAsFilename(fileFilter:="xlsx Files (*.xlsx), *.xlsx")
If fileSaveName <> False Then
ActiveSheet.range(rng).Copy
Set NewBook = Workbooks.Add
Set rngArr() = Split(rng, ":")
@DouglasdeMoura
DouglasdeMoura / getRowAndCol.vb
Created July 6, 2015 13:53
Get row and col of a button when clicked
Public Function ButtonRow()
Dim b As Object, RowNumber As Integer
Set b = ActiveSheet.Buttons(Application.Caller)
With b.TopLeftCell
RowNumber = .Row
End With
ButtonRow = RowNumber
End Function
Public Function ButtonCol()
@DouglasdeMoura
DouglasdeMoura / Save.vb
Created July 10, 2015 14:33
Functions to save data
Public Function RowNumber(Col As String, Optional RowOffset As Variant = 1, Optional ColumnOffset As Variant = 0) As Long
RowNumber = Cells(Rows.Count, Col).End(xlUp).Offset(RowOffset, ColumnOffset).Row
End Function
Public Function SaveData(Columns As Variant, Data As Variant, RowNumber As Long)
Dim i As Long
i = 1
For Each Column In Columns
Range(Column & RowNumber) = Data(i)
MathJax.Hub.Config({
showProcessingMessages: false,
tex2jax: {
inlineMath: [
['$', '$'],
['\\(', '\\)']
]
},
extensions: [
'toMathML.js'
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>LaTeX para Word</title>
<meta name="description" content="Escreva em LaTeX e copie diretamente para o Word!">
<link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css" rel="stylesheet">
<link rel='stylesheet' id='genericons-css' href='http://engenharialivre.com/wp-content/plugins/jetpack/_inc/genericons/genericons/genericons.css?ver=3.1' type='text/css' media='all'/>
<link rel='stylesheet' id='eng-fonts-css' href='https://fonts.googleapis.com/css?family=Fira+Sans%3A500%2C300italic%2C300%2C700italic%2C700%7COpen+Sans%3A300%2C300italic%2C700%2C700italic&#038;ver=4.3' type='text/css' media='all'/>
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@DouglasdeMoura
DouglasdeMoura / functions.php
Created April 12, 2016 14:30 — forked from hlashbrooke/functions.php
WordPress: Create a custom metabox that works in exactly the same way as the existing 'Featured Image' box on the post edit screen. In this case the image is called 'Listing Image' (with all the function and variable names correlating to that), but you can change the strings to whatever you need them to be.
<?php
add_action( 'add_meta_boxes', 'listing_image_add_metabox' );
function listing_image_add_metabox () {
add_meta_box( 'listingimagediv', __( 'Listing Image', 'text-domain' ), 'listing_image_metabox', 'post', 'side', 'low');
}
function listing_image_metabox ( $post ) {
global $content_width, $_wp_additional_image_sizes;
$image_id = get_post_meta( $post->ID, '_listing_image_id', true );
@DouglasdeMoura
DouglasdeMoura / widget.php
Last active April 14, 2016 20:19
Template to create WordPress Widgets
<?php
class My_Widget extends WP_Widget {
/**
* Sets up the widgets name etc
*/
public function __construct() {
$widget_ops = array(
'classname' => 'my_widget',