Skip to content

Instantly share code, notes, and snippets.

View kontur's full-sized avatar

Johannes Neumeier kontur

View GitHub Profile
@arrowtype
arrowtype / README.md
Last active October 8, 2021 13:15
The basics of working with unicode values in Python

Unicode values in Python

Unicodes can either be integers (“A” is 65, “B” is 66, etc) or hex (“A” is 0x41, “B” is 0x42, etc).

When scripting with RoboFont or FontTools, a hard thing at first is that different styles come up in different contexts. For example, integers will often be used in scripts, but hex values are shown in UIs and in the TTX output of cmap (the table that maps unicode values to glyphs). So, it's helpful to know how to go between them to do different types of work.

To go from a string to an unicode integer, you can use ord(), like:

>>> ord("A")
@LaurenaRehbein
LaurenaRehbein / stripe-icon-edit.php
Created January 12, 2018 00:12
A sample of the edited function
add_filter( 'wc_stripe_payment_icons', 'change_my_icons' );
function change_my_icons( $icons ) {
// var_dump( $icons ); to show all possible icons to change.
$icons['visa'] = '<img src="http://woocommerce-ext.reh/wp-content/plugins/woocommerce/assets/images/icons/credit-cards/visa.svg" />';
$icons['mastercard'] = '<img src="http://woocommerce-ext.reh/wp-content/plugins/woocommerce/assets/images/icons/credit-cards/mastercard.svg" />';
$icons['amex'] = '<img src="http://woocommerce-ext.reh/wp-content/plugins/woocommerce/assets/images/icons/credit-cards/amex.svg" />';
return $icons;
}
@prestonparris
prestonparris / reactjs-conf-2015-notes.md
Last active April 6, 2017 21:32
Notes from the 2015 React.js Conference

Reactjs conf 2015 Notes

  • react native announced

    • Allows you to use react style javascript to target native ios and android, native views, live reloading
    • intro pt1
    • intro pt2
    • facebook groups app uses react native with graphql and relay
  • realtime page tweaking

    • rethink best practices and workflows
  • inmutability is a good idea

@companje
companje / globe.cpp
Created September 24, 2014 13:31
getting Longitude/Latitude when clicking on a rotated sphere
#include "ofMain.h"
class ofApp : public ofBaseApp {
public:
ofImage earth;
ofQuaternion qTo;
float angle;
ofVec3f axis;
ofPoint green;
@bhubbard
bhubbard / .htaccess
Last active December 25, 2023 02:59
This is my template .htaccess file for WordPress on Cloud Sites.
# Apache Server Config | MIT License
# https://gist.github.com/bhubbard/6082577
# Modified from https://github.com/h5bp/server-configs-apaches
# ##############################################################################
# # Default WordPress #
# ##############################################################################
# http://randomtype.ca/blog/the-wordpress-htaccess-file-explained/
# BEGIN WordPress
@SachaG
SachaG / MeteorMethodInTemplateHelper.js
Last active September 22, 2016 01:39
Use the return value of a Meteor method in a template helper.
if(Meteor.isClient){
// set Session variable in method callback
Meteor.call('myMeteorMethod', "foo", function(error, result){
Session.set('myMethodResult', result);
});
// use reactive Session variable in helper
Template.myTemplate.helpers({
myHelper: function(){
{
"directory": "components"
}
@cobyism
cobyism / gh-pages-deploy.md
Last active November 11, 2024 00:02
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).

@iMoses
iMoses / jquery.plugin.wrapInGroups.js
Created July 26, 2012 12:21
jQuery Plugin wrapInGroups
/**
* Takes a jQuery collection and wraps each 'groupSize' items with 'wrapHtml'
* Example: $('#Example span').wrapInGroups('<div/>', 4);
* Will wrap every 4 span's inside #Example with a div
* See for yourself: http://jsfiddle.net/M9ZFh/
* Author: iMoses ([email protected])
*/
(function($) {
$.fn.wrapInGroups = function(wrapHtml, groupSize) {
var selector = this.selector;
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/