Skip to content

Instantly share code, notes, and snippets.

void main () {
var settings = new Settings ("org.example.my-app");
// Getting keys
var greeting = settings.get_string ("greeting");
var bottles = settings.get_int ("bottles-of-beer");
var lighting = settings.get_boolean ("lighting");
print ("%s\n", greeting);
print ("%d bottles of beer on the wall\n", bottles);
@brpaz
brpaz / devilspie2_commands.txt
Created November 8, 2018 21:31
Devislpie2 commands
get_window_name()
returns a string containing the name of the current window.
get_application_name()
returns the application name of the current window.
set_window_position(xpos, ypos)
Sets the position of a window.
set_window_size(xsize, ysize)
@brpaz
brpaz / .elasticsearch_cheat_sheet.md
Last active May 2, 2024 02:30
ElasticSearch cheat cheat

ElasticSearch cheat sheet

@brpaz
brpaz / ssl_certificate_generator.sh
Created May 2, 2015 09:47 — forked from bradland/gencert.sh
Bash script for generating an ssl certificate #ssl
#!/bin/bash
# Bash shell script for generating self-signed certs. Run this in a folder, as it
# generates a few files. Large portions of this script were taken from the
# following artcile:
#
# http://usrportage.de/archives/919-Batch-generating-SSL-certificates.html
#
# Additional alterations by: Brad Landers
# Date: 2012-01-27
@brpaz
brpaz / example.spec.js
Created March 12, 2019 21:52
#vuejs #testing
import { shallowMount } from '@vue/test-utils';
import HelloWorld from '@/components/HelloWorld.vue';
describe('HelloWorld.vue', () => {
it('renders props.msg when passed', () => {
const msg = 'new message';
const wrapper = shallowMount(HelloWorld, {
propsData: { msg },
});
expect(wrapper.text()).toMatch(msg);
@brpaz
brpaz / xdtool.md
Created February 3, 2019 10:42
Set window size with xdtool #xdtool #linux

Set window size with xdtool

Find the window ID:

xdotool search --onlyvisible --name firefox

Set the window size

@brpaz
brpaz / config.yml
Created March 17, 2019 19:08
Sample config.yml for publishing to NPM from CircleCI
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2.1
defaults: &defaults
working_directory: ~/repo
docker:
- image: circleci/node
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
#
# Custom headers and headers various browsers *should* be OK with but aren't
#
<script>
import gql from 'graphql-tag';
// GraphQL query
const postsQuery = gql`
query allPosts {
posts {
id
title
votes
describe('Post Resource', function() {
it('Creating a New Post', function() {
cy.visit('/posts/new') // 1.
cy.get('input.post-title') // 2.
.type('My First Post') // 3.
cy.get('input.post-body') // 4.
.type('Hello, world!') // 5.