Skip to content

Instantly share code, notes, and snippets.

Sam SamR1

Block or report user

Report or block SamR1

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@davlgd
davlgd / pi_soc_monitor.py
Created Jul 30, 2019
Raspberry Pi SoC monitoring script
View pi_soc_monitor.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import csv
import time
delay = 2
csv_file = "pi_soc_results.csv"
@mauri870
mauri870 / manjaro-avell-g1513.md
Last active Sep 16, 2019
Installation of Manjaro 17 and nvidia/bumblebee drivers on Avell G1513
View manjaro-avell-g1513.md

After a weekend of research, stress and pain I finally figure out how to install manjaro 17 and configure the nvidia/bumblebee drivers on my avell laptop

Here's my notebook specs:

$ inxi -MGCNA

Machine:   Device: laptop System: Avell High Performance product: 1513
           Mobo: N/A model: N/A v: 0.1 UEFI: American Megatrends v: N.1.02 date: 09/28/2016
Battery    BAT0: charge: 44.0 Wh 100.0% condition: 44.0/44.0 Wh (100%)
@MaxenceCauderlier
MaxenceCauderlier / Tpl.php
Created Feb 12, 2017
Simple PHP Template Engine
View Tpl.php
<?php
class Tpl
{
/** @var string Chemin du template */
protected $filepath;
/** @var string Contenu du template */
protected $filecontent;
@makevoid
makevoid / geth_mine.js
Last active Oct 16, 2016
Geth mining script, run as last argument of geth via `js geth_mine.js` - source: https://gist.github.com/makevoid/5a618d73c4eff110a21c
View geth_mine.js
// fork of mine.js script on embark-framework, this script mines only if there are new transactions in the pool
var eth, config, main, pendingTransactions, startTransactionMining;
eth = web3.eth;
console.log('geth_mine.js: start');
console.log("node infos: " + (JSON.stringify(admin.nodeInfo)));
config = {
threads: 2 // set this to the number of threads you machine can handle, remember to set a low difficulty in your genesis block to mine faster
@gokulkrishh
gokulkrishh / media-query.css
Last active Sep 19, 2019
CSS Media Queries for Desktop, Tablet, Mobile.
View media-query.css
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@niksumeiko
niksumeiko / git.migrate
Last active Sep 18, 2019
Moving git repository and all its branches, tags to a new remote repository keeping commits history
View git.migrate
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@danielthiel
danielthiel / SQLAlchemy_cast.py
Last active Aug 6, 2019
SQLAlchemy: filter by date for an datetime field(does not work with SQLite, with PostgreSQL it works fine)
View SQLAlchemy_cast.py
from datetime import date
from sqlalchemy import cast, DATE
Match.query.filter(cast(Match.date_time_field, DATE)==date.today()).all()
@synox
synox / install SonarQube on Raspberry Pi
Last active Jun 6, 2019
How to install SonarQube on Raspberry PI
View install SonarQube on Raspberry Pi
SonarQube does currently not support Raspberry PI.
This is a workaround. It compiles a armv6 compatible version of the java-wrapper and configures sonarqube to use it.
(Testet with Raspbian, wheezy, 3.6)
Compile java-wrapper for ARMv6
============================
Download latest version of " wrapper_prerelease_XY.tar" from http://wrapper.tanukisoftware.com/downloads/ (for me 3.5.17 works)
@vgoklani
vgoklani / app.py
Last active Jul 30, 2019
Using Flask to output Python data to High Charts
View app.py
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
@app.route('/index')
def index(chartID = 'chart_ID', chart_type = 'bar', chart_height = 350):
chart = {"renderTo": chartID, "type": chart_type, "height": chart_height,}
series = [{"name": 'Label1', "data": [1,2,3]}, {"name": 'Label2', "data": [4, 5, 6]}]
title = {"text": 'My Title'}
@richard-flosi
richard-flosi / bottle-cors.py
Created Sep 26, 2012
Bottle with Cross-origin resource sharing (CORS)
View bottle-cors.py
"""
Example of setting up CORS with Bottle.py.
"""
from bottle import Bottle, request, response, run
app = Bottle()
@app.hook('after_request')
def enable_cors():
"""
You can’t perform that action at this time.