Skip to content

Instantly share code, notes, and snippets.

View akrizs's full-sized avatar
💭
Working

Anton Kristensen akrizs

💭
Working
View GitHub Profile
@akrizs
akrizs / generators.py
Last active March 27, 2022 20:31
A set of generators to generate collection of prime, composites, odd, even, fibonacci and squarable numbers...
from math import sqrt
def is_prime(num: int):
for n in range(2,int(num**0.5)+1):
if num%n==0:
return False
return True
def is_composite(num: int):
return not is_prime(num)
@akrizs
akrizs / browsercheck.js
Created October 31, 2018 21:14
BrowserCheck => Hope to revisit this later...
helpers.bc = {
bx: document.createElement('div'),
st: document.createElement('div').style,
is() {
if (this.safari()) {
return 'Safari';
}
if (this.chrome()) {
return 'Chrome';
Date.prototype.toDatetimeLocal =
function toDatetimeLocal() {
var
date = this,
ten = function (i) {
return (i < 10 ? '0' : '') + i;
},
YYYY = date.getFullYear(),
MM = ten(date.getMonth() + 1),
@akrizs
akrizs / bs-config.js
Created September 23, 2018 21:47 — forked from Kenty/bs-config.js
browser-sync setting file
/*
|--------------------------------------------------------------------------
| Browser-sync config file
|--------------------------------------------------------------------------
|
| Please report any issues you encounter:
| https://github.com/shakyShane/browser-sync/issues
|
| For up-to-date information about the options:
| https://github.com/shakyShane/browser-sync/wiki/Working-with-a-Config-File
/* ----------------------------------------------------------------------------------------------------
Super Form Reset
A couple of things to watch out for:
- IE8: If a text input doesn't have padding on all sides or none the text won't be centered.
- The default border sizes on text inputs in all UAs seem to be slightly different. You're better off using custom borders.
- You NEED to set the font-size and family on all form elements
- Search inputs need to have their appearance reset and the box-sizing set to content-box to match other UAs
@akrizs
akrizs / do-dyndns.sh
Created May 21, 2018 00:40
DigitalOcean Dynamic DNS Updater
#!/bin/bash
# Function to split out the json value fetched from DigitalOcean to parse out just the IP adress.
# You have to install jq for this to work, the parsing of the current stored ip depends on it: https://stedolan.github.io/jq/
function extractip {
temp=`echo $ip_received | jq -r '.domain_record.data'`
echo ${temp}
};
# Your domain name
domain="YOUR-DOMAIN"
@akrizs
akrizs / gulpfile.js
Created May 8, 2018 22:20 — forked from haydenbleasel/gulpfile.js
Catalyst: task automation boilerplate for experienced web developers
const gulp = require('gulp'),
sync = require('browser-sync').create(),
del = require('del'),
minimist = require('minimist')(process.argv.slice(2)),
$ = require('gulp-load-plugins')(),
info = require('./package.json'),
header = '/*! Built with Catalyst. */',
staticFiles = gulp.src([
'test/source/**/*',
'!test/source/**/*.html',
@akrizs
akrizs / gruntfile.js
Created May 8, 2018 21:04 — forked from danalmeida/gruntfile.js
boilerplate Grunt configuration
module.exports = function(grunt) {
// 1. All configuration goes here.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
options: {
style: 'compressed'

Gulp guide for designers

Gulp is a Task / Build runner. It's easy to use, has a simple api, and is efficient. Gulp.js makes use of pipes for streaming data that needs to be processed.

But as designer you don't actually need to know any of that. What you do need to know is that Gulp will make your life much easier.

This tutorial will setup Gulp to do 3 things:

  • Compress js
  • Compile less
@akrizs
akrizs / outline-server-setup.md
Created May 8, 2018 20:44 — forked from okeehou/outline-server-setup.md
How to setup an Outline VPN Server on Ubuntu 16.04

How to setup an Outline VPN Server on Ubuntu 16.04 Server

This guide will show you how to install Outline Server on an Ubuntu 16.04 Server, use Outline Manager for Windows and connect to your Outline Server on Windows and Anroid.

Install Outline Manager

Outline Manager supports Windows, macOS and Linux.

Outline Manager for Windows