Skip to content

Instantly share code, notes, and snippets.

View adamlwgriffiths's full-sized avatar
💭
Working in a silo

Adam Griffiths adamlwgriffiths

💭
Working in a silo
  • Twisted Pair Development
  • Melbourne, Australia
View GitHub Profile
@adamlwgriffiths
adamlwgriffiths / gitea.md
Last active April 7, 2024 22:17
Setup Gitea on Synology DiskStation NAS

Synology Gitea setup

Install Docker

Package Centre > Docker > Install

Create folders

    /docker/gitea/postgresql
 /docker/gitea/gitea
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import cyglfw3 as glfw
import time
import math
if not glfw.Init():
exit()
@adamlwgriffiths
adamlwgriffiths / selenium_test.py
Created June 1, 2017 23:23
Selenium test for issue #2214
from __future__ import absolute_import
from contextlib import contextmanager
from random import choice
from urlparse import urljoin
import traceback
import re
import time
import numpy
import ujson as json
import os
These URLs were redirected to when I attempted to download Malware Bytes.
It attempted to download a similarly named (mb2...) executable (.exe) instead.
http://www.reimagemac.com/mac/?tracking=revz2&banner=ak%20efix%20ron%20au%20cpi%204&adgroup=direct&ads_name=direct&keyword=malwarebytes.com&context=591a431e025ed400135f9163
http://7spzz.detect.005732.xyz/PCV816advancedmacALL.html
http://7spzz.detect.005732.xyz/?sov=87986171&hid=bfndfdftfppfhfhn&&redid=39705&gsid=453&campaign_id=12&p_id=12255&id=XNSX.glob-r39705-t453&impid=de69b3ca-39cb-11e7-b4a4-12c26be3c49e
http://www.advancedmactools.com//ytz/1/?x-context=M212EVOCLQD8D83Y&utm_source=mytzcps1&utm_campaign=mytzcps1&pxl=MYT1698_MYT1663_RUNT&utm_pubid=39705&x-at=de69b3ca-39cb-11e7-b4a4-12c26be3c49e
http://eflzz.alldownloads.hapc.gdn/?sov=87986171&hid=brdndfdrtfppfhfhn&&redid=39705&gsid=453&campaign_id=12&p_id=12255&id=XNSX.glob-r39705-t453&impid=ea076c86-39cb-11e7-8b24-aa1f778d2780
http://all.shipyards.xyz/?sov=87986171&id=XNSX.glob-r39705-t453-&tov=637816&v=&
@adamlwgriffiths
adamlwgriffiths / Heroku error log
Created March 17, 2016 23:53
cannot load such file -- bundler/setup (LoadError)
-----> Fetching set buildpack https://github.com/ddollar/heroku-buildpack-multi.git... done
-----> Multipack app detected
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-ruby.git
=====> Detected Framework: Ruby
-----> Compiling Ruby
-----> Using Ruby version: ruby-2.2.2
-----> Installing dependencies using bundler 1.11.2
Your app was upgraded to bundler 1.11.2.
Previously you had a successful deploy with bundler 1.9.7.
from __future__ import absolute_import, print_function, unicode_literals
from django.db import models, transaction
from django.utils import six
from django.apps import apps
from django.core.exceptions import FieldDoesNotExist
try:
# Django 1.7
from django.contrib.admin.utils import NestedObjects
except ImportError:
# Django < 1.7
var loadScript = function(url, callback) {
/*
JavaScript that will load the jQuery library on Google's CDN.
We recommend this code: http://snipplr.com/view/18756/loadscript/.
Once the jQuery library is loaded, the function passed as argument,
callback, will be executed.
*/
var script = document.createElement("script");
script.type = "text/javascript";
@adamlwgriffiths
adamlwgriffiths / gist:517aaf5ba5abcb4b6f16
Created January 7, 2015 07:21
EditBox placement error
var IOS_NamePlayer = cc.Scene.extend({
layer: null,
next_scene: null,
text_field: null,
placeholder: "Input text here",
ctor: function() {
this._super();
this.layer = cc.Layer.create();
Process: python2.7 [557]
Path: /Users/USER/*/python
Identifier: python2.7
Version: ???
Code Type: X86-64 (Native)
Parent Process: bash [443]
Responsible: iTerm [427]
User ID: 501
Date/Time: 2014-06-13 03:16:45.990 +1000
@adamlwgriffiths
adamlwgriffiths / test_flask_security.py
Created May 7, 2014 03:23
Testing flask security auth issues
from flask import Flask, Blueprint, Response, request, request_finished, request_started
from flask.views import MethodView
from flask.ext.security import Security, MongoEngineUserDatastore, UserMixin, RoleMixin, current_user, auth_required, login_required
from flask.ext.security.utils import login_user, verify_password, encrypt_password
from flask.ext.security.decorators import _check_token
import mongoengine
from mongoengine import StringField, BooleanField, DateTimeField, ListField, ReferenceField, LongField, ObjectIdField
from flask.ext.mongoengine import MongoEngine, Document
import json