Skip to content

Instantly share code, notes, and snippets.

@i5ar
i5ar / gist:b47123ba64ebc43da526
Last active August 29, 2015 14:10
Blender Flip Normals
import bpy
scene = bpy.context.scene
for ob in scene.objects:
if ob.type == 'MESH':
scene.objects.active = ob
bpy.ops.object.mode_set(mode='EDIT', toggle=False)
# Run an edit-mode operator on every object in the scene [1]
# [1]: http://blender.stackexchange.com/a/2639/8112
@i5ar
i5ar / gist:6e1b9561a815a2c6b35d
Last active August 29, 2015 14:11
Sverchok K-Dimensional Tree Vertex
{
"export_version": "0.054",
"framed_nodes": {},
"groups": {},
"nodes": {
"Integer": {
"bl_idname": "IntegerNode",
"color": [
0.6079999804496765,
0.6079999804496765,
@i5ar
i5ar / gist:34a38c00127f7d9b526a
Last active August 29, 2015 14:11 — forked from jedsundwall/gist:586144
Add commas to items in an unordered list
ul.tags {
display: inline;
margin: 0;
padding: 0;
}
ul.tags li {
display: inline;
list-style: none;
margin: 0;
padding: 0;
@i5ar
i5ar / functions.php
Last active August 29, 2015 14:23
The iSarch theme functions file
<?php
// Sets up includes functions
include_once( ABSPATH . 'wp-content/themes/twentyfourteen-child/inc/enqueues.php' );
include_once( ABSPATH . 'wp-content/themes/twentyfourteen-child/inc/post-types.php' );
include_once( ABSPATH . 'wp-content/themes/twentyfourteen-child/inc/media-gallery.php' );
include_once( ABSPATH . 'wp-content/themes/twentyfourteen-child/inc/featured-template-tags.php' );
// Disable dashboard widgets
add_action('admin_menu', 'disable_default_dashboard_widgets');
function disable_default_dashboard_widgets() {
@i5ar
i5ar / cogiar.js
Last active November 2, 2015 03:11
Lazy Line Painter page in jQuery Mobile
(function( $ ){
$(document).ready(function(){
var $demo = $('#demo');
var svgData = {
"demo": {
"strokepath": [
{
"path": "m 23.083,12.562 0,-2.822 0.935,0.11 0,-2.115 L 12.729,6.007 0,8.43 l 0,2.473 1.18,-0.164 0,6.872 3.423,0 0,6.414 16.25,1.969 2.875,-0.348 0,-8.232 5.107,0.016 0,7.596 2.373,-0.287 0,-10.038 0.792,0.039 0,-1.504 -8.917,-0.674 z",
"duration": 3200,
'strokeWidth': 0.2,
@i5ar
i5ar / drawing.js
Last active November 23, 2015 17:31
var pathObj = {
"drawing": {
"strokepath": [
{
"path": "m 177.29113,3.795453 c -64.75119,0 -117.242311,52.490947 -117.242311,117.242517 0,50.25905 31.63369,93.11682 76.072141,109.78745 l 27.01777,-72.04807 c -15.27566,-5.72982 -26.14953,-20.4629 -26.14953,-37.73938 0,-22.25826 18.04413,-40.302475 40.30193,-40.302475 22.2578,0 40.30271,18.044215 40.30271,40.302475 0,17.27648 -10.87466,32.00956 -26.15033,37.73938 l 27.01777,72.04807 c 44.43768,-16.67063 76.07215,-59.5284 76.07215,-109.78745 0,-64.75157 -52.49034,-117.242517 -117.2423,-117.242517 z",
"duration": 1000
}
],
"dimensions": {
"width": 355,
@i5ar
i5ar / drawing2.js
Last active November 23, 2015 23:14
var pathObj = {
"drawing2": {
"strokepath": [
{
"path": "m 204.27539,193.85742 c 30.7333,-11.34413 51.15322,-40.62465 51.17773,-73.38476 1.7e-4,-43.236842 -35.05026,-78.287271 -78.2871,-78.287113 -43.23685,-1.66e-4 -78.287279,35.050266 -78.287114,78.287113 0.04333,32.73752 20.452384,61.99115 51.162114,73.33398",
"duration": 600
}
],
"dimensions": {
"width": 355,
@i5ar
i5ar / p5.isarch.js
Last active October 17, 2016 00:10
Drawing
// Based on Drawing example
// http://p5js.org/examples/demos/Hello_P5_Drawing.php
// All the paths
var paths = [];
// Are we painting?
var painting = false;
// How long until the next circle
var next = 0;
// Where are we now and where were we?
var current;
@i5ar
i5ar / encode.js
Last active October 17, 2016 00:09 — forked from djq/unions
Union from a list of geometries in GeoDjango
// Encode array
var json_string = JSON.stringify(features_array);
console.log(json_string); // ["POLYGON((13.80796143 42.56851169000001,13.80769846 42.568553580000014,13.80777101 42.568770150000006,13.80804818 42.568736520000016,13.80796143 42.56851169000001))","POLYGON((13.8078327 42.56894971,13.80810299 42.568905150000006,13.80804818 42.568736520000016,13.80777101 42.568770150000006,13.8078327 42.56894971))"]
@i5ar
i5ar / slim.py
Last active October 17, 2016 00:07
Slim code
import os
import re
def abbrev():
'''Shrink variables'''
for dirpath, dirnames, filenames in os.walk('imap\\contrib\\imap'):
for i in filenames:
name, extension = os.path.splitext('imap\\contrib\\imap\\'+ i)
if extension == '.py':
# Create abbreviation files directory