Skip to content

Instantly share code, notes, and snippets.

View sdvg's full-sized avatar
🐦

Stefan Dietz sdvg

🐦
View GitHub Profile
@sdvg
sdvg / input.scss
Created January 5, 2021 16:01
Generated by SassMeister.com.
.overlay {
@at-root .mobile & {
color: green;
}
@at-root :not(.mobile) & {
color: red;
}
}
@sdvg
sdvg / input.scss
Created January 5, 2021 16:01
Generated by SassMeister.com.
.overlay {
@at-root .mobile & {
color: green;
}
@at-root :not(.mobile) & {
color: red;
}
}
@sdvg
sdvg / hoodieClient.js
Created April 3, 2017 18:26
Hoodie with react native
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);
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
}
(function () {
'use strict';
//code
})();
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)
}
@sdvg
sdvg / dabblet.css
Created March 11, 2013 10:04
Untitled
* {
margin: 0; padding: 0;
}
.wrap {
width: 500px;
margin: 0 auto;
position: relative;
}
// 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 January 7, 2013 14:15
make form action "reset" work for chosen-fields
//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 November 29, 2012 15:34
quick-select the right option from a large dropdown with timezones
  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;
 }