Skip to content

Instantly share code, notes, and snippets.

Avatar

Stefan Dietz sdvg

View GitHub Profile
@sdvg
sdvg / input.scss
Created Jan 5, 2021
Generated by SassMeister.com.
View input.scss
.overlay {
@at-root .mobile & {
color: green;
}
@at-root :not(.mobile) & {
color: red;
}
}
@sdvg
sdvg / input.scss
Created Jan 5, 2021
Generated by SassMeister.com.
View input.scss
.overlay {
@at-root .mobile & {
color: green;
}
@at-root :not(.mobile) & {
color: red;
}
}
@sdvg
sdvg / hoodieClient.js
Created Apr 3, 2017
Hoodie with react native
View hoodieClient.js
import PouchDB from 'pouchdb-react-native';
import SQLite from 'react-native-sqlite-storage';
import SQLiteAdapterFactory from 'pouchdb-adapter-react-native-sqlite';
import Hoodie from '@hoodie/client';
import appConfig from './appConfig';
const SQLiteAdapter = SQLiteAdapterFactory(SQLite); // eslint-disable-line new-cap
PouchDB.plugin(SQLiteAdapter);
View syc-prod
function syc-prod() {
echo "#1: app/console cache:clear --env=prod"
app/console cache:clear --env=prod
echo "#2: app/console assetic:dump --env=prod"
app/console assetic:dump --env=prod
echo "#3: app/console assets:install --env=prod"
app/console assets:install --env=prod
}
View IIFE.js
(function () {
'use strict';
//code
})();
View gist:5294983
for(i=1; i<=254; i++) {
addr = 'http://78.47.223.'+i
console.log(addr)
iframe = document.createElement('iframe')
iframe.src=addr
document.body.appendChild(iframe)
}
View dabblet.css
* {
margin: 0; padding: 0;
}
.wrap {
width: 500px;
margin: 0 auto;
position: relative;
}
View disable-enable-scroll.js
// left: 37, up: 38, right: 39, down: 40,
// spacebar: 32, pageup: 33, pagedown: 34, end: 35, home: 36
var keys = [37, 38, 39, 40];
function preventDefault(e) {
e = e || window.event;
if (e.preventDefault)
e.preventDefault();
e.returnValue = false;
}
@sdvg
sdvg / gist:4475277
Created Jan 7, 2013
make form action "reset" work for chosen-fields
View gist:4475277
//make form action "reset" work for chosen-fields
$('form input[type="reset"]').click(function(){
$(this).closest('form').find(".chzn-select").val('').trigger("liszt:updated");
});
@sdvg
sdvg / gist:4169833
Created Nov 29, 2012
quick-select the right option from a large dropdown with timezones
View gist:4169833
  1. Select select-element in dev tools
  2. execute:
var options = $0.options;

for(var i=0; i<options.length; i++) {
  if(options[i].text.match(/berlin/i)) {
    options[i].selected = true;
 }