Skip to content

Instantly share code, notes, and snippets.

View jmsdnns's full-sized avatar

Jms Dnns jmsdnns

View GitHub Profile
@jmsdnns
jmsdnns / sudoku.swift
Created May 23, 2015 01:20
Sudoku solver in Swift
#!/usr/bin/env xcrun swift
class Board {
let b = -1
let hborder = "-------------\n"
let vborder = "|"
let width = 9
let height = 9
var board: [[Int]]
@jmsdnns
jmsdnns / sudoku.py
Created May 23, 2015 01:20
Sudoku solver in Python
#!/usr/bin/env python
import sys
import StringIO
class Board:
BLANK = ' '
BORDER_HOR = '-------------\n'
BORDER_VER = '|'
WIDTH = 9
@jmsdnns
jmsdnns / testssh.go
Last active June 9, 2023 13:33
SSH to Vagrant instance with Golang
package main
import (
"bytes"
"fmt"
"golang.org/x/crypto/ssh"
"io/ioutil"
"log"
"os"
"time"
@jmsdnns
jmsdnns / testingviper.go
Last active August 29, 2015 14:26
Trying out Cobra and Viper for Go
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"reflect"
"github.com/spf13/cobra"
@jmsdnns
jmsdnns / no_generics.go
Last active August 30, 2015 02:31
Q: What does it mean that Go doesn't support Generics? -- A: This snippet.
package main
import (
"fmt"
)
type Whatever interface {
foo()
}
@jmsdnns
jmsdnns / meeseeks.py
Last active February 29, 2016 04:01
From CSV sheets to InDesign
#!/usr/bin/env python
# Copy this code into a file called meeseeks.py
# Run like: $ python meeseeks.py file_1.csv file_2.csv file_3.csv
# Output is a new csv called meeseeks.csv
import csv
import sys
import os
@jmsdnns
jmsdnns / yuge_key
Created March 11, 2016 02:42
16384 bit key
$ ./g10/gpg --armor --export jdennis@gmail.com
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mQgNBFbiJmYBQADr2iJ7HVPjXab+tHBEXKTJRR550pQjtWNLiOQFwxWWXzkC6VDx
nGLYe+rKT71ztn6DhXu5HQSDMKJrewDjYHURN/yCyh+++/K6hzACiFxEICA8CTpu
1dwh+r/Ahkmbw9+ZwpFx6kcjlLjfT53k6qOda1FjakpsGEN01mwwIlUNwfcMb0jP
FpgAFdcraiL74bBaPDgykDVYKufaQY6Fsdt2uOD/c1GKrLrdZUoRsTe1GwvbrGEX
+P1QRWvb4usZcl+ylRFeO2LCTNwRIrNBWu/WmNi6VX2sKtDABPYx4xR8QdtJ23e1
rsf3r+wQCu27EuNy1NqqkZShh7xUyL/KMIQvNNBmXpXd9ZT4dxtj/4QToBeW/BhP
@jmsdnns
jmsdnns / base_models.py
Created April 15, 2016 04:16
super bare bones implementation of schematics logic
# TYPES
class TypeError(Exception):
pass
class BaseType(object):
def __get__(self, instance, owner):
return instance._values.get(self.field_name, None)
def __set__(self, instance, value):
@jmsdnns
jmsdnns / walk_through_twitter.js
Last active June 1, 2018 17:10
PhantomJS code for scrolling to the end of a Twitter timeline
var fs = require('fs'),
page = new WebPage(),
url = 'https://twitter.com/jmsdnns',
stepOffset = 0,
stepCounter = 0,
full_path = "/Users/jmsdnns/Projects/ghst/img-tw";
page.open(url);
page.onLoadFinished = function(status) {
@jmsdnns
jmsdnns / bk_swift.coc.md
Last active July 11, 2016 14:26
Draft for BK Swift Code of Conduct

Code of Conduct

Brooklyn Swift is a community of programmers. A welcoming community. A community that appreciates and encourages open inquiry. A community that celebrates building amazing things. If you are a Swift programmer or are interested in becoming one, please come join us!

We want this community to be fun, safe, and welcoming for every attendee. Because we all come from different backgrounds, we want to be concrete about what sorts of behaviors jeopardize the warmth of our community and are therefore unacceptable. This code of conduct applies to all Brooklyn Swift spaces, including our mailing lists and any related social events.

Social Rules

An important part of removing obstacles to a great community is having a small set of social rules. The Recurse Center's manual does a great job defining these, so we've forked parts for this section.