Skip to content

Instantly share code, notes, and snippets.

View jmsv's full-sized avatar
🏠
Working from home

James Vickery jmsv

🏠
Working from home
View GitHub Profile
@bahorn
bahorn / facebook_auth.py
Last active February 8, 2018 16:27
Hacked up Flask server to login to authorise as a facebook user.
import os
import json
import binascii
import requests
from flask import Flask, request
app = Flask(__name__)
# Web app to get use a user token from Facebook
app_id = "<BLANKED>"
app_secret = "<BLANKED>"
@bahorn
bahorn / etherpads.md
Last active January 28, 2018 01:35
HackSoc etherpads

CovHackSoc Organisation Etherpads

We like to use etherpad to plan most things. We use the instance hosted under wikimedia. They should be backed up regularly.

HackSoc planning (early)

Etherpad we used to plan stuff early on.

https://etherpad.wikimedia.org/p/l1d8VyBwdC

@keithweaver
keithweaver / example-of-l293d-two-motors.py
Created March 27, 2017 19:33
Example of using L293D Python Library
# Run the following commands in the terminal/command line:
# pip install l293d
# or (I had to run as root):
# sudo pip install l293d
#
# I also needed to install Yaml
# So:
# pip install pyyaml
# or I had to run with sudo:
# sudo pip install pyyaml
@tntclaus
tntclaus / generateAndroidDrawables.sh
Last active November 1, 2023 18:24
Simple Android drawable image resource generator script with specified DP with ImageMagic or Inkscape
#!/bin/sh
# Example usage:
# ./generateAndroidDrawables.sh my_image.png 140 /absolute/path/to/android/res/drawables
#
# Will generate 140dp android drawables for 6 DPI on out/my_image.png/ directory.
# Be sure your original image has sustainable resolution for xxxhdpi drawable,
# which is 140 x 4 PX in case of this example.
#
# Requires ImageMagic
# SVG conversion recommended to be done with Inkscape:
@Jaykul
Jaykul / Adding Fonts Without Elevation.md
Last active November 20, 2023 20:55
Temporary Font Install?

Did you know you can install fonts without elevation?

The catch is that they're only available for the duration of your session. They are, however, available in all apps across the system.

Someone asked about how to do it on Facebook this week, and at first, I just pointed them at the install script for PowerLineFonts which loops through all the fonts in a folder and install them.

I've used this more than a few times to install some fonts, including the PowerLine ones, which are great:

$sa = New-Object -ComObject Shell.Application
@FinlayDaG33k
FinlayDaG33k / gist:23a6134b1ad3e5f867a64219a374406e
Last active February 12, 2024 19:30
Minergate-cli ubuntu installation
Run this command to install MG-CLI:
sudo apt-get update && wget https://minergate.com/download/deb-cli -O minergate-cli.deb && sudo dpkg -i minergate-cli.deb
to start miner (4 cores for BCN) use this command:
minergate-cli -user <YOUR@EMAIL.KAPPA> -bcn 4
Feel free to send some of your earnings to me:
BTC (Don't attempt to send other coins to this address!): 17f77AYHsQbdsB1Q6BbqPahJ8ZrjFLYH2j
@rxaviers
rxaviers / gist:7360908
Last active May 10, 2024 03:51
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@samidhtalsania
samidhtalsania / bintree.py
Last active October 28, 2022 14:28
Binary tree in Python
class Node():
def __init__(self,key):
self.key = key
self.left = None
self.right = None
self.parent = None
class Tree():
@miguelgrinberg
miguelgrinberg / rest-server.py
Last active March 29, 2024 09:05
The code from my article on building RESTful web services with Python and the Flask microframework. See the article here: http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask_httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':
@danielestevez
danielestevez / gist:2044589
Last active April 10, 2024 07:51
GIT Commit to an existing Tag
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Include the fix manually if it's just a change ....
git add .
git ci -m "Fix included"
or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}