Skip to content

Instantly share code, notes, and snippets.

@squarepegsys
squarepegsys / profile.ps1
Last active October 18, 2021 16:44
Powershell setup
# install Github Desktop to get their config
# then you can do this
# https://desktop.github.com/
. (Resolve-Path "$env:LOCALAPPDATA\GitHub\shell.ps1")
# then install psget and install modules
# before putting these lines in here
# see https://github.com/psget/psget
Import-Module PowerLs
@squarepegsys
squarepegsys / git-alias.sh
Last active August 29, 2015 14:22
git aliases
alias gss='git status --short'
alias gl='git smart-log'
alias gm='git smart-merge'
alias gup='git smart-pull'
@squarepegsys
squarepegsys / buttons.js
Last active August 29, 2015 14:21
ReactJS Demo
var index = this.state.index;
var state = states.states.state[index]["@attributes"];
var prevButton ="";
var nextButton ="";
if (index>0) {
prevButton = <button type="button" className="btn btn-primary" onClick={this.handlePrev}>Prev</button>;
}
if (index<50) {
nextButton= <button type="button" className="btn btn-primary" onClick={this.handleNext}>Next</button>;
@squarepegsys
squarepegsys / .aliases.sh
Last active August 29, 2015 14:20
Shell Aliases
alias l="ls -l"
alias unzip="unzip -q"
alias edit=$EDITOR
alias dl='dirs -v'
alias c=clear
alias ack="nocorrect ack"
alias redir="$EDITOR ~/.diraliases; source $HOME/.diraliases"
### git stuff
alias gss='git status --short'
@squarepegsys
squarepegsys / gvmup.sh
Created April 7, 2015 14:55
A handy little alias for Grails developers that support apps that could be one of many Grails versions
alias gvmup="gvm use grails `grep app.grails.version application.properties|gawk -F = '{print $2}'`"
/*
* Copyright (c) 2013 Yan Pujante
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
package books.admin
class AuthorAdmin {
static options = {
list includes: ["lastName", "firstName", "lastUpdated","dateCreated"]
create includes: ["firstName","lastName"]
edit includes: ["firstName","lastName"]
}
@squarepegsys
squarepegsys / Config.groovy
Created March 2, 2015 02:07
grails admin-interface exampl
grails.plugin.admin.domains = [
"books.admin.Author",
"books.admin.Book"
]
grails.plugin.admin.domain.Author="books.admin.AuthorAdmin"
grails.plugin.admin.domain.Book="books.admin.BookAdmin"
grails.plugin.admin.accessRoot = "/admin"
@squarepegsys
squarepegsys / build.gradle
Created December 2, 2014 19:12
Gradle and Groovy
sourceSets {
main {
groovy {
// override the default locations, rather than adding additional ones
srcDirs = ['src/main/groovy', 'src/main/java']
}
java {
srcDirs = [] // don't compile Java code twice
}
}
@squarepegsys
squarepegsys / template_resuse.groovy
Created October 28, 2014 17:39
Reusing a template
import groovy.text.SimpleTemplateEngine
class Member{
String firstName
String lastName
String lodge
}
def text = '${firstName} ${lastName} is a member of the ${lodge}'