Skip to content

Instantly share code, notes, and snippets.

View gcman105's full-sized avatar

Gary Cheeseman gcman105

View GitHub Profile
@dunglas
dunglas / example.php
Created April 19, 2018 06:25
A minimalist GraphQL client for PHP
<?php
$query = <<<'GRAPHQL'
query GetUser($user: String!) {
user (login: $user) {
name
email
repositoriesContributedTo {
totalCount
}
@gcman105
gcman105 / gitignore-all-but-org.md
Last active August 29, 2015 14:08
.gitignore to ignore almost everything apart from `.org` files.

I have set up the gitignore to ignore almost everything apart from .org files.

.gitignore file

*
!.gitattributes
!.gitignore
!README.md
!.gitkeep
@gcman105
gcman105 / .vimrc
Last active October 3, 2020 11:21
Gary Cheeseman, gcman105's .vimrc file
" .vimrc
" Author: Gary Cheeseman <gary@cheeseman.me.uk>
" http://gary.cheeseman.me.uk
"
" vim: foldmethod=marker
"
" The line below allows me to update the Gist with the command :Gist
" GistID: 5821422
"-----------------------------------------------------------------------------
# Tkinter and GPIO together
from Tkinter import *
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(24, GPIO.OUT)
GPIO.output(24, GPIO.LOW)
def toggle():
@cobyism
cobyism / gh-pages-deploy.md
Last active May 6, 2024 08:07
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@mjtko
mjtko / howto.md
Created November 2, 2012 18:56 — forked from goosetav/howto.md
prevent ttf fonts while running poltergeist

RE: teampoltergeist/poltergeist#44

Use Rack::SimpleEndpoint to prevent Poltergeist/PhantomJS from crashing on TTF fonts.

Create config/initializers/middleware-deny-ttf-to-phantomjs-under-test.rb:

if Rails.env.test?
  require 'rack/contrib/simple_endpoint'
 Rails.application.config.middleware.insert_after Rack::Runtime, Rack::SimpleEndpoint, /\.ttf$/ do |req, res|
@jaberg
jaberg / ipython-virtualenv.py
Created November 1, 2012 15:49 — forked from bsweger/ipython-virtualenv.py
(Linux) make iPython virtual env aware
#------------------------------------------------------------------------------
# Make things VirtualEnv aware (Linux version).
# More info: http://www.swegler.com/becky/blog/2011/08/28/python-django-mysql-on-windows-7-part-3-ipython-virtual-environments/
# add this to the end of ipython_config
# (or course, for virtualenvs created via --no-site-packages, it would
# be much easier just to install iPython)
#
# Also consider sourcing this file from ipython_config with execfile().
#
#------------------------------------------------------------------------------
@ibarovic
ibarovic / forms.py
Created July 11, 2012 20:00
django crispy forms and django inline forms example (inlineformset_factory)
class AuthorForm(ModelForm):
def __init__(self, *args, **kwargs):
self.helper = FormHelper()
self.helper.form_tag = False
self.helper.layout = Layout(
Field('name'),
)
super(AuthorForm, self).__init__(*args, **kwargs)
class Meta:
model = Author
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active April 26, 2024 23:26 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@ChasManRors
ChasManRors / gist:2920837
Created June 12, 2012 23:43
Yasnippet issue Debugger entered when emacs.d/init.el executes (yas/global-mode 1)
(emacs-version nil)
; =>
;"GNU Emacs 24.0.97.1 (x86_64-apple-darwin, NS apple-appkit-1038.36)
; of 2012-05-16 on bob.porkrind.org"
(add-to-list 'load-path "~/.emacs.d/plugins/yasnippet")
; =>
; ("~/.emacs.d/plugins/yasnippet" "~/.emacs.d/rc-site-lisp" "/Users/cmmagid/.emacs.d/el-get/package/elpa/idle-highlight-mode-1.1.2" "/Users/cmmagid/.emacs.d/el-get/package/elpa/rainbow-mode-0.2" "/Users/cmmagid/.emacs.d/el-get/package/elpa/ruby-electric-1.1" "/Users/cmmagid/.emacs.d/el-get/package/elpa/save-visited-files-1.2" "/Users/cmmagid/.emacs.d/el-get/package/elpa/wrap-region-0.6.0" "/Users/cmmagid/.emacs.d/el-get/yasnippet" "/Users/cmmagid/.emacs.d/el-get/yaml-mode" "/Users/cmmagid/.emacs.d/el-get/vline" "/Users/cmmagid/.emacs.d/el-get/tree-mode" "/Users/cmmagid/.emacs.d/el-get/rinari/util/jump/" ...)
(require 'yasnippet)
; =>