Skip to content

Instantly share code, notes, and snippets.

@afucher
afucher / consoleDir.cs
Created Jan 19, 2021
[dotnet] Imprime propriedades e valores de um objeto
View consoleDir.cs
foreach(PropertyDescriptor descriptor in TypeDescriptor.GetProperties(obj))
{
string name=descriptor.Name;
object value=descriptor.GetValue(obj);
Console.WriteLine("{0}={1}",name,value);
}
@afucher
afucher / git-anonymize
Created Oct 13, 2019 — forked from pozorvlak/git-anonymize
Anonymise Git history
View git-anonymize
#!/bin/sh
# Suppose you want to do blind reviewing of code (eg for job interview
# purposes). Unfortunately, the candidates' names and email addresses are
# stored on every commit! You probably want to assess each candidate's version
# control practices, so just `rm -rf .git` throws away too much information.
# Here's what you can do instead.
# Rewrite all commits to hide the author's name and email
for branch in `ls .git/refs/heads`; do
View header.js
import { Link } from "gatsby"
import PropTypes from "prop-types"
import React, { useState } from "react"
const Header = ({ siteTitle }) => {
useState(false);
return (
<header
style={{
background: `rebeccapurple`,
View createPdf.js
'use strict';
const PDFDocument = require('pdfkit');
const fs = require('fs');
const printHeader = doc => {
const opt = {continued: true};
doc.text("Name", opt);
doc.x = 200;
doc.text("Start date", opt);
doc.x = 250;
@afucher
afucher / example.spec.js
Created Nov 2, 2018
vue cli service error
View example.spec.js
import { expect } from 'chai'
import VueResource from 'vue-resource'
describe('HelloWorld.vue', () => {
it('renders props.msg when passed', () => {
expect(true).to.be.true
})
})
View EstudoSlice.go
package main
import (
"fmt"
)
func main() {
tstSlice2()
}
View GroupController.js
'use strict';
const CreateGroupList = require('../utils/GroupsListPDF');
const Group = require('../models').Group;
const Client = require('../models').Client;
const Course = require('../models').Course;
const ClientGroup = require('../models').ClientGroup;
const Boom = require('boom');
const moment = require('moment');
const fields = ['id','start_date','end_date','start_hour','end_hour','course_id','classes','teacher_id','classes'];
const teacher = {model: Client, as: 'Teacher', attributes: ['name']}
@afucher
afucher / ConsoleWrapper.cs
Created Sep 13, 2017 — forked from logicseed/ConsoleWrapper.cs
C# .NET 4.5 Console Wrapper
View ConsoleWrapper.cs
//-----------------------------------------------------------------------------
// C# .NET 4.5 Console Wrapper
//
// Marc King < mjking@umich.edu >
// v1.0 2015-04-26
//-----------------------------------------------------------------------------
using SysConsole = System.Console;
using System;
using System.IO;
View ConsoleApp.cs
using System;
using System.Threading;
class Program
{
static void Main(string[] args)
{
Loop();
}
View tab_veeValidate.vue
<template>
<div>
<form @submit.prevent="formSubmit">
<vue-tabs>
<v-tab title="Personal Info">
<div class="form-group">
<label>Name</label>
<input v-validate="'required'" name="name" type="text" v-model="client.name" class="form-control">
<span v-show="errors.has('name')" class="bg-danger">{{ errors.first('name') }}</span>
</div>