Skip to content

Instantly share code, notes, and snippets.

View adamhunter's full-sized avatar

Adam Hunter adamhunter

View GitHub Profile
package main
import (
"fmt"
_ "github.com/go-sql-driver/mysql"
"github.com/jmoiron/sqlx"
)
type Hoge struct {
@ygotthilf
ygotthilf / jwtRS256.sh
Last active November 7, 2024 10:42
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@obfusk
obfusk / break.py
Last active September 2, 2024 16:23
python "breakpoint" (more or less equivalent to ruby's binding.pry); for a proper debugger, use https://docs.python.org/3/library/pdb.html
import code; code.interact(local=dict(globals(), **locals()))
@justinbaker999
justinbaker999 / evil.rb
Created November 17, 2014 18:24
evil programmer fiend.. usage ruby evil.rb <filetoreplace>
s=IO.read(ARGV[0]);File.write(ARGV[0], s.gsub(";","\u037E"))
// Make our app module, its easier to do this in raw javascript
// and then put the rest of our app content (controllers etc)
// in their own coffeescript files.
//
// Your ng-app should include this module name, eg: <html ng-app="TodoApp">
angular.module('TodoApp', []);
@jwarchol
jwarchol / README.md
Created July 28, 2012 21:06
Breathing LED on a Raspberry Pi

Raspberry Pi Breathing LED

This is a demonstration of using Ruby and the WiringPi Gem to pulse an LED connected to a GPIO pin in a manner similar to the sleep indicator on a MacBook.

A video of the effect can be found here: http://www.youtube.com/watch?v=NCUMXK7qf-c

@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
def output name=((default=true); "caius")
puts "name: #{name.inspect}"
puts "default: #{default.inspect}"
end
output
# >> name: "caius"
# >> default: true
output "avdi"
@nowhereman
nowhereman / Object_tap.html
Last active June 11, 2016 21:27
Object#tap in JavaScript
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Object#tap in JavaScript</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript" src="http://sugarjs.com/javascripts/sugar-0.9.5.min.js"></script>
<script type="text/javascript">
jQuery.noConflict();
(function($) {
@jakebellacera
jakebellacera / nginx-apache-reverse-proxy-wordpress-mu-vhost.conf
Created September 21, 2010 23:39
Useful nginx virtual host configuration for reverse proxy (proxy_pass) with Apache
# useful nginx configuration for reverse proxy with Apache
# edit lines 8, 11, and 30
# taken from: http://syslog.tv/2010/01/11/debian-apache-2-nginx-wordpress-mu/
# edits by jakebellacera (http://github.com/jakebellacera && http://jakebellacera.com)
server {
listen 80;
server_name domain.com *.domain.com; # edit this to your domain