Skip to content

Instantly share code, notes, and snippets.

@i5ar
i5ar / gist:d016372e5574b71421af
Last active August 29, 2015 14:05
Responsive Circle
/* Responsive Circle */
.circle-text {
width:50%;
margin-left:auto;
margin-right:auto;
}
.circle-text:after {
content: "";
display: block;
width: 100%;
/* Triangle */
.triangle { position: relative; }
.triangle::before {
border-top: 0;
border-right: 175px solid transparent;
border-bottom: 175px solid transparent;
border-left: 175px solid #af2715;
position: absolute;
content: "";
z-index:3;
@i5ar
i5ar / gist:20596d66988eb40be6cc
Last active August 29, 2015 14:07
Forms with Conditional Logic
jQuery(document).ready(function() {
// Hide the field initially
jQuery(".field_2").hide(); // <div class="field_2">
// Show the text field only when the third option is chosen - this doesn't
jQuery('#field_1').change(function() { // <select id="field_1">
if (jQuery("#field_1").val() == "Nope") { // <option value="Nope">
jQuery(".field_2").show();
} else {
jQuery(".field_2").hide();
}
@i5ar
i5ar / gist:cf09395ac8de27a4c9e2
Last active August 29, 2015 14:09
Get BuddyPress User's Group
$group_ids = groups_get_user_groups( bp_loggedin_user_id() );
var_dump( $group_ids["groups"] );
foreach( $group_ids["groups"] as $id ) {
$group = groups_get_group( array( 'group_id' => $id ) );
echo '<pre>';
var_dump( $group );
echo '</pre>';
}
// Print group name
$group_name = $group->name;
@i5ar
i5ar / gist:d00be523d57c19506a99
Last active August 29, 2015 14:10
Organization
# Add file extension
import os
import glob
os.chdir("C:/Users/myFolder")
aList = []
for file in glob.glob("*"):
print(file)
# Add extension if does not exist
if '.' not in file:
@i5ar
i5ar / gist:bccf36e165a0747028a4
Last active August 29, 2015 14:10
Sphinx Hack
d = vars(opts)
- for k, v in d.items():
+ for k, v in list(d.items()):
# delete None or False value
if v is None or v is False:
del d[k]
@i5ar
i5ar / gist:dae5ef2105f21c032c00
Last active August 29, 2015 14:10
Sverchok Simple Cross Section
{
"export_version": "0.054",
"framed_nodes": {},
"groups": {},
"nodes": {
"Axis Input": {
"bl_idname": "svAxisInputNode",
"color": [
0.6079999804496765,
0.6079999804496765,
@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;