Skip to content

Instantly share code, notes, and snippets.

@newtone
newtone / gist:5203935
Created March 20, 2013 11:17
jQuery viewport switcher: a switch, giving the possibility to change to desktop mode in mobile view.
// viewport stuff
var targetWidth = 960;
var deviceWidth = 'device-width';
var viewport = $('meta[name="viewport"]');
// check to see if local storage value is set on page load
localStorage.isResponsive = (localStorage.isResponsive === undefined) ? 'true' : localStorage.isResponsive;
localStorage.showBrowserSwitcher = (localStorage.showBrowserSwitcher === undefined) ? 'true' : localStorage.showBrowserSwitcher;
@newtone
newtone / literals.js
Last active September 6, 2020 21:01
function example
const name = (firstName, lastName) => {
console.log(`${firstName} ${lastName}`);
};
.parent::before {
content: "";
display: inline-block;
height: 100%;
vertical-align: middle;
}
.child {
display: inline-block;
vertical-align: middle;
{
/* midpoint defaults to 50% */
background: linear-gradient(#fff, #bbf);
/* midpoint set to 80% */
background: linear-gradient(#fff, 80%, #bbf);
}
@newtone
newtone / purge
Last active October 5, 2020 11:33
# Remove old kernels
#
alias purge-old-kernels='dpkg -l '\''linux-*'\'' | sed '\''/^ii/!d;/'\''"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'\''/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'\'' | xargs sudo apt-get -y purge'
<h1>Some Text</h1>
<div class="split-text-container">
<h1 data-text="Split Colors">Split Colors</h1>
</div>
@newtone
newtone / keys
Last active November 19, 2020 13:16
Alt + 5: [
Alt + 6: ]
Alt + 7: |
Alt + 8: {
Alt + 9: }
// new css structure -> as seen in https://matthiasott.com/notes/how-i-structure-my-css
/scss/
├── 1-settings
│ └── _global.scss
├── 2-design-tokens
│ ├── _colors.scss
│ ├── _fonts.scss
│ ├── _media-queries.scss
│ ├── _spacing.scss
* {
box-sizing: border-box;
}
:root {
--color: rgba(0, 0, 0, 0.55);
}
body {
margin: 0;