Skip to content

Instantly share code, notes, and snippets.

View dowens's full-sized avatar

Derek D Owens dowens

View GitHub Profile
@dowens
dowens / reclaimWindows10.ps1
Created July 13, 2016 02:08 — forked from alirobe/reclaimWindows10.ps1
"Reclaim Windows 10" turns off a bunch of unnecessary Windows 10 telemetery, removes bloatware, and privacy invasions. Review and tweak before running. Scripts for reversing are included and commented. Forked from http://pastebin.com/gQxCUkLP
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Original Version: 1.4, 2016-01-16
# Tweaked based on personal preferences for @alirobe 2016-03-23 - v1.4.1
# NOTE: MAKE SURE YOU READ THIS SCRIPT CAREFULLY BEFORE RUNNING IT + ADJUST COMMENTING AS APPROPRIATE
# This script will reboot your machine when completed.
##########
# Ask for elevated permissions if required
@dowens
dowens / readline.go
Last active March 11, 2016 18:31
read lines from file in Go
func readLine(path string) {
inFile, err := os.Open(path)
if err != nil {
log.Fatal(err)
}
defer inFile.Close()
scanner := bufio.NewScanner(inFile)
scanner.Split(bufio.ScanLines)
@dowens
dowens / ErrorController.groovy
Created October 11, 2015 02:00
Alternate grails controller template and url mapping for adding a scaffolded JSON API
package gvl
import grails.converters.JSON
class ErrorController {
// Forbidden
def error403() {
withFormat {
html { render(view: 'error403') }
@dowens
dowens / gist:4ef78453b0e41dc201f3
Created August 26, 2015 20:35
Verifying that +dowens is my blockchain ID. https://onename.com/dowens
Verifying that +dowens is my blockchain ID. https://onename.com/dowens
@dowens
dowens / keybase.md
Created March 30, 2014 03:58
keybase.md

Keybase proof

I hereby claim:

  • I am dowens on github.
  • I am dowens (https://keybase.io/dowens) on keybase.
  • I have a public key whose fingerprint is 964F 93AC 2C13 3BC6 B220 145F 7EC1 0285 17D8 592C

To claim this, I am signing this object:

upstream upstream_server {
server 127.0.0.1;
keepalive 512;
}
server {
listen *:80;
location / {

true and false vs. "truthy" and "falsey"

Many programming languages, including Ruby, have native boolean (true and false) data types. In Ruby they're called true and false. In Python, for example, they're written as True and False.

But oftentimes we want to use a non-boolean value (integers, strings, arrays, etc.) in a boolean context (if statement, &&, ||, etc.). So someone designing a language has to decide what values count as "true" and what count as "false." A non-boolean value that counts as true is called "truthy," and a non-boolean value that counts as false is called "falsey."

#!/usr/bin/env ruby
# Rulog - Ruby Syslog Server
# Captures syslog events and spits them out to Growl.app
# Useful for on-spot debugging of a device with remote syslog support
# Blocking IO
# Run as root
require 'socket'
=begin
Requisitos Minimos para rodar este script:
#jruby 1.1 ou superior (nao testei com superior :D)
apt-get install jruby
#baixar o oracle jdbc (para o 10g, ou procure a versão que deseje) de:
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc_10201.html
#copiar o ojdbc14.jar para (usar sudo):