Skip to content

Instantly share code, notes, and snippets.

View ronaldlangeveld's full-sized avatar

Ronald Langeveld ronaldlangeveld

View GitHub Profile
@ronaldlangeveld
ronaldlangeveld / LoadShedding.10m.sh
Created December 15, 2019 08:38
Loadshedding Bitbar plugin
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# <bitbar.title>Loadshedding Status</bitbar.title>
# <bitbar.version>v0.2</bitbar.version>
# <bitbar.author>Ronald Langeveld</bitbar.author>
# <bitbar.author.github>ronaldlangeveld</bitbar.author.github>
# <bitbar.image>https://i.imgur.com/JA7S0t7.png</bitbar.image>
# <bitbar.desc>Shows the current Loadshedding 💩 status</bitbar.desc>
# <bitbar.dependencies>python</bitbar.dependencies>
#
const _ = require(`lodash`)
const Promise = require(`bluebird`)
const path = require(`path`)
exports.createPages = ({ graphql, actions }) => {
const { createPage } = actions
const createPosts = new Promise((resolve, reject) => {
const postTemplate = path.resolve(`./src/templates/blogTemplate.js`)
resolve(
graphql(`
@ronaldlangeveld
ronaldlangeveld / bulmagrid.css
Last active January 30, 2019 10:52
bulmagrid
.container {
margin: 0 auto;
position: relative;
}
@media screen and (min-width: 1088px) {
.container {
max-width: 960px;
width: 960px;
}
import os
import datetime
from datetime import datetime
from flask import Flask
import json
from flask import request, url_for
from flask_sqlalchemy import SQLAlchemy
from flask import jsonify, json, request
from flask_cors import CORS
from flask_bcrypt import Bcrypt
.bigHeaderFont {
font-size: 20em;
}
@media (max-width:1024px) {
.bigHeaderFont {
font-size:10em;
}
function ResizeImage() {
var description = $('#imgdescription').val();
var project_name = $('#project_name').val();
if (window.File && window.FileReader && window.FileList && window.Blob) {
var filesToUploads = document.getElementById('imageFile').files;
var file = filesToUploads[0];
if (file) {
var reader = new FileReader();
// Set the image once loaded into file reader
//HtML
<form>
{% csrf_token %}
<input type="file" name="pic" accept="image/*" id="image">
<input type="submit" id="send">
</form>
//JS
@ronaldlangeveld
ronaldlangeveld / json
Created March 12, 2018 21:12
json xml to text
import json
import io
mydata = json.load(io.open('library.json', 'r', encoding='utf-8-sig'))
# print(mydata['plist']['dict']['dict']['dict'][1]['string'][0])
a = mydata['plist']['dict']['dict']['dict']
for k in a:
data = k['string']
song = data[0]
artist = data[1]
print(song, ' , ', artist)
@ronaldlangeveld
ronaldlangeveld / gist:6cde23f627dac3e501704a26317f3142
Created January 9, 2018 07:20
USING JSON WITH JAVASCRIPT BASICS
USING JSON WITH JAVASCRIPT BASICS.
CREDIT GOES TO: https://github.com/Fanna1119
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400" rel="stylesheet">
</head>
@ronaldlangeveld
ronaldlangeveld / gist:c3e87f94b97afc66096a40e9440df44c
Created January 4, 2018 18:39
How to add your Python bot as a startup service on your Ubuntu Server
[Unit]
Description=bot
After=network.target
[Service]
User=username
Type=idle
ExecStart=/home/user/bots/venv/bin/python3.6 /home/user/bots/botscript.py
[Install]