Skip to content

Instantly share code, notes, and snippets.

View michsch's full-sized avatar

Michael Schulze michsch

View GitHub Profile
@michsch
michsch / getSCSSFromCSS.js
Last active August 29, 2015 14:05
Grunt configuration to copy CSS files and change the filename extension to SCSS.
/**
* http://gotofritz.net/blog/geekery/rename-files-while-copying-grunt/
*/
module.exports = function( grunt ) {
"use strict";
grunt.initConfig({
//copy all css files to sass directory, and rename to .scss
copy: {
@michsch
michsch / .gitconfig
Last active September 4, 2019 12:15
GIT alias
[alias]
co = checkout
br = branch
ci = commit
st = status
unstage = reset HEAD --
last = log -1 HEAD
graph = log --graph
amsi = commit --amend --signoff
amend = commit --amend
@michsch
michsch / xhr.coffee
Last active August 29, 2015 14:15
Cross Browser XML HTTP Request (AJAX)
###
* Cross Browser XML HTTP Request
* https://stackoverflow.com/questions/2557247/easiest-way-to-retrieve-cross-browser-xmlhttprequest
*
* Gist: https://gist.github.com/michsch/acf8d51039e078f8fe07
###
### global
ActiveXObject,
define,
@michsch
michsch / dabblet.css
Created February 17, 2015 19:22
box-shadow vs filter: drop-shadow
/**
* box-shadow vs filter: drop-shadow
*/
body {
background: #aaa;
font: 16px/1 sans-serif;
}
div {
margin: 100px;
@michsch
michsch / condition.haml
Created March 10, 2015 18:00
Test case for RuboCop Style/EmptyElse warning
- if Rails.env == 'development'
:css
.jw-non-functional {
box-shadow: 0 0 6px 4px rgba(255, 127, 80, .6);
}
- else
:css
.jw-non-functional {
display: none;
}
@michsch
michsch / dabblet.css
Created April 3, 2016 02:32
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
html {
font-size: 100%;
}
html,
body {
@michsch
michsch / index.html
Last active April 24, 2016 16:24
Replace no-js class in HTML element
<html class="no-js" lang="de">
<head>
<meta charset="utf-8">
<title>JS class in HTML</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/main.css">
<script>
!function(s,e){'use strict';s=document.getElementsByTagName('html')[0],e=s.className.split(' '),e.indexOf('no-js')>-1&&e.splice(e.indexOf('no-js'),1),-1===e.indexOf('js')&&e.push('js'),s.className=e.join(' ')}()
@michsch
michsch / javascript.json
Last active October 7, 2020 13:18
Nunjucks with custom filter for number_format
"paths": {
"nunjucks": "../Vendor/nunjucks/dist/js/nunjucks"
},
"map": {
"*": {
"nunjucks": "Service/Factory/nunjucksFactory/nunjucksFactory"
},
"Service/Factory/nunjucksFactory/nunjucksFactory" : {
"nunjucks" : "nunjucks"
}
@michsch
michsch / .hoodierc
Created June 13, 2017 15:50
hoodie authentication problem
{
"address": "127.0.0.1",
"port": 8080,
"data": ".hoodie",
"public": "public",
"dbUrl": "http://admin:[email protected]:5984/prototype",
"adminPassword": "admin",
"dbAdapter": "pouchdb-adapter-fs",
"inMemory": false,
"loglevel": "warn",
@michsch
michsch / userlike.js
Last active July 28, 2017 13:02
Userlike-Integration
const userlikeUrl = '//userlike-cdn-widgets.s3-eu-west-1.amazonaws.com/d050a6fa8bdcd3986a4892b683ae79565fa04643cbec254c91b489c49806bdef.js'
window.userlikeTrackingEvent = function (event_name, global_ctx, session_ctx) {
console.log('userlikeTrackingEvent: name=%s global_ctx=%o session_ctx=%o',
event_name,
global_ctx,
session_ctx
)
}