Skip to content

Instantly share code, notes, and snippets.

View samdroid-apps's full-sized avatar
🙂
Hope you're having a great day

Sam Parkinson samdroid-apps

🙂
Hope you're having a great day
View GitHub Profile
@samdroid-apps
samdroid-apps / gist:9008602
Created February 14, 2014 20:28
Develop Log
** Message: pygobject_register_sinkfunc is deprecated (HippoCanvasBox)
Traceback (most recent call last):
File "/usr/bin/sugar-activity", line 164, in <module>
main()
File "/usr/bin/sugar-activity", line 122, in main
module = __import__(module_name)
File "/home/olpc/Activities/Develop.activity/develop_app.py", line 45, in <module>
import logviewer
File "/home/olpc/Activities/Develop.activity/logviewer.py", line 36, in <module>
from sourceview_editor import SearchablePage
@samdroid-apps
samdroid-apps / main.py
Last active August 29, 2015 13:56
maths-fractal-area
import math
# This is run recusivly
# s is the length of the squares sides
# x is a counter
def f(s, x):
if x == 1: # if x = 1 then
# return returns the value and quits the function
return s * s # Just return the square if we are on the end
@samdroid-apps
samdroid-apps / 0_reuse_code.js
Created April 27, 2014 01:00
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
/**
* Cool Locks
*/
background: linear-gradient(-45deg, rgba(255, 255, 255, 0) 25%, #C16 25%, #C16 50%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0) 75%, #C16 75%, #C16),
linear-gradient(45deg, rgba(255, 255, 255, 0) 25%, #AC0 25%, #AC0 50%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0) 75%, #AC0 75%, #AC0),
radial-gradient(red, yellow);
background-size: 200px 200px, 200px 200px, auto;
min-height: 100%;
@samdroid-apps
samdroid-apps / selector.py
Last active December 29, 2015 11:49
Python3 thumby folder selector. In GTK.
import os
from gi.repository import Gtk
path_to_file = {}
def getDirs(path, parent_item, tree_data_store):
if os.path.exists(path):
for file in os.listdir(path):
filepath = os.path.join(path, file)
if os.path.isdir(filepath):
@samdroid-apps
samdroid-apps / gist:8087172
Last active January 1, 2016 03:39
Canvas Github-Code-Stats-Style Graph for Flask
<canvas id="myCanvas" height="20">
YOUR BROWSER IS TOO OLD
</canvas>
<script>
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
var MAX = c.scrollWidth;

Keybase proof

I hereby claim:

  • I am samdroid-apps on github.
  • I am samtoday (https://keybase.io/samtoday) on keybase.
  • I have a public key ASDfACD4DDRtbMe2V58cDx6Y12J-nhJB3pktPNkSQDnAAwo

To claim this, I am signing this object:

@samdroid-apps
samdroid-apps / podcast.txt
Created September 4, 2017 12:46
Podcast transcript
*Bubble sound effect fading out^
*Splash sound effect*
Agent 1: Where is it? Where did you hide it ?
Ivan: Huh?
Agent 1: The hard disk?
Ivan: You must look inside your heart and to find the motherland…*incoherent mumbling: UglyfyJS2, top the download charts of NPM it vill; trust me* -* gets splashed*
@samdroid-apps
samdroid-apps / btrfs-nixos-install.sh
Last active February 3, 2023 13:16 — forked from alcol80/btrfs-nixos-install.sh
nixos install (boot + btrfs)
mkfs.vfat -n BOOT /dev/sda1
mkfs.btrfs -L root /dev/sda2
mount -t btrfs /dev/sda2 /mnt/
btrfs subvolume create /mnt/nixos
umount /mnt/
mount -t btrfs -o subvol=nixos /dev/sda2 /mnt/
btrfs subvolume create /mnt/var
btrfs subvolume create /mnt/home
btrfs subvolume create /mnt/tmp
@samdroid-apps
samdroid-apps / 01-relume-tooltip-powerup.md
Last active April 12, 2023 01:12
Relume Tooltip Powerup

Relume Tooltips Script

This script is included in all of the tooltip components from Relume Library's UI Elements. It adds 2 features:

  1. Flip the tooltip to the opposite direction, to keep it within the viewport:
Screencast.from.2023-04-06.10-14-10.webm
  1. Slide the tooltip along the perpendicular axis, to keep it within the viewport: