Skip to content

Instantly share code, notes, and snippets.

Jure Cuhalev gandalfar

Block or report user

Report or block gandalfar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@BigWhale
BigWhale / tailwind-config.js
Last active Jun 27, 2019
Tailwind more pseudo classes and variants
View tailwind-config.js
variants: {
margin: ['responsive', 'last-child', 'first-child', 'odd-child', 'even-child'],
},
plugins: [
function({ addVariant, e }) {
addVariant('first-child', ({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.${e(`first-child${separator}${className}`)}:first-child`
})
})
@westonruter
westonruter / shutdown-handler.php
Last active Mar 22, 2019
Disable WSOD detection on WordPress 5.1 so that fatal errors during development don't constantly cause plugins to suspend
View shutdown-handler.php
<?php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName
/*
* Plugin Name: Non-Handling Shutdown Handler
* Description: Disable WSOD protection so that plugins will not auto-suspend during development while errors often occur.
* Plugin URI: https://gist.github.com/westonruter/583a42392a0b8684dc268b40d44eb7f1
* Plugin Author: Weston Ruter
*/
/**
@dehuszar
dehuszar / detokenize
Created Nov 8, 2016
Use to extract extra values from your token
View detokenize
/* Usage
* {{detokenize 'extraValue'}} */
import Ember from 'ember';
const { get, inject } = Ember;
export default Ember.Helper.extend({
session: inject.service(),
compute(params) {
@BrianSipple
BrianSipple / ember-addon-essentials.md
Last active Apr 17, 2017
Ember Addon Essentials -- A checklist of some of the finer details to keep in mind when developing Ember addons
View ember-addon-essentials.md

Ember Addon Essentials

This document is meant to be a brief "checklist" of things to setup for your Ember addon when beginning development in order to have the best possible architecture and workflow out of the gate. For more comprehensive material, the following are bookshelf-caliber:

Filling out package.json

View dont_do_this.py
import traceback
import re
def debug_var(a):
s = traceback.extract_stack(limit=2)[0][3]
g = re.match("\w+\((\w+)\)", s)
print("%s = %r" % (g.group(1), a))
def main():
foo=1
@AndrewChamp
AndrewChamp / docx_editor.php
Created Jul 27, 2015
Edit a Microsoft Word .docx file using PHP and the zip extension.
View docx_editor.php
<?php
/**
* Edit a Word 2007 and newer .docx file.
* Utilizes the zip extension http://php.net/manual/en/book.zip.php
* to access the document.xml file that holds the markup language for
* contents and formatting of a Word document.
*
* In this example we're replacing some token strings. Using
* the Office Open XML standard ( https://en.wikipedia.org/wiki/Office_Open_XML )
* you can add, modify, or remove content or structure of the document.
@maxogden
maxogden / readme.md
Last active Nov 13, 2018
list of interdisciplinary open source conferences
View readme.md

Interdisciplinary Open Source Community Conferences

Criteria

  • Must be an event that someone involved in open source would be interested in attending
  • Must be a community oriented event (no corporate owned for-profit events here please)
  • Can't be about a specific language/framework.

Leave suggestions in the comments below

@rafibomb
rafibomb / 2-column-stacking
Created Nov 15, 2014
2 Column Stacking Inline Links on Mobile - Ink Responsive HTML Email
View 2-column-stacking
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width"/>
<link rel="stylesheet" href="ink.css"> <!-- For testing only -->
<link type="text/css" rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.css" />
<style type="text/css">
@mosne
mosne / gist:75b3ce1f0098663f2b1a
Last active Aug 17, 2018
Migrate images form a Magic Fields to ACF (inside a wordpress loop)
View gist:75b3ce1f0098663f2b1a
<?php
$photo_name = get_field("cover");
if ($photo_name != "") {
$ff = '/Users/mosne/Sites/Dropbox/mosne.local/wp-content/files_mf/' . $photo_name;
$handle = fopen($ff, "r");
$ffcontents = fread($handle, filesize($ff));
$attachment = wp_upload_bits($photo_name, null, $ffcontents);
@acka47
acka47 / serendipity-only-orgs
Created Feb 12, 2014
orgs described in serendipity map data that aren't part of OCW consortium
View serendipity-only-orgs
{
"consortiumURL" : "http://www.universia.net/",
"ocwURL" : "Flamenco?q=UniversityName:33&group=UniversityName",
"universityContinent" : "North America",
"universityLogo" : "http://www.anahuac.mx/images/stories/contenido/la_universidad/logo_universidad_anahuac_chico.gif",
"universityOCWURL" : "http://educommons.anahuac.mx:8080/eduCommons/",
"universityURL" : "http://www.anahuac.mx/",
"universityCountry" : "Mexico",
"universityURI" : "http://dbpedia.org/resource/Universidad_An%C3%A1huac_M%C3%A9xico_Norte",
"universityLong" : "-99.267674",
You can’t perform that action at this time.