Skip to content

Instantly share code, notes, and snippets.

@jgraber
jgraber / get_twitter_bookmarks.py
Created January 12, 2022 22:47 — forked from divyajyotiuk/get_twitter_bookmarks.py
Python code to get text and link of the bookmarked tweets and save in markdown
import json
import glob
all_bookmarks = []
md_file = open("bookmarks.md", "w+") # saving in markdown file, if no file exists using '+' creates one
files = [file for file in glob.glob("JSONBookmarks/*")] # using glob to read all files from the folder
for file_name in files:
print(file_name)
with open(file_name) as bk:
@jgraber
jgraber / gist:02a020aae576d7b235c62d4c104da551
Created February 22, 2019 12:47 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Using self-signed certificate.

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
# ...
# standard rails stuff here
# ...
Rake::TestTask.new([:test, :lockdown]) do |t|
t.test_files = FileList[
'test/functional/lockdown_test.rb'
]
end
@jgraber
jgraber / readme.md
Last active December 16, 2015 11:49

Programming in HTML5 with JavaScript and CSS3

Implement and manipulate document structures and objects (24%)

Create the document structure

@jgraber
jgraber / demo.rb
Created March 28, 2012 20:33
Connect from Ruby to PostgreSQL
require 'pg'
require 'ap'
def connect(db, user, pw)
PGconn.new('localhost', 5432, '', '', db, user, pw)
end
def show_shops2(conn)
conn.exec( "SELECT haendler_id AS id, * from tbl_haendler;" ) do |result|
result.each do |row|
package ch.jgraber.blog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;