Skip to content

Instantly share code, notes, and snippets.

View majman's full-sized avatar
🐢
Turtle

Marshall Jones majman

🐢
Turtle
View GitHub Profile
@majman
majman / toggle-desktop-icons.applescript
Created April 6, 2020 18:41
toggle visibility of desktop icons
display dialog "Desktop icons visible or hidden?" buttons {"Visible", "Hidden"} with icon 2 with title "Switch to presentation mode" default button 1
set switch to button returned of result
if switch is "Hidden" then
do shell script "defaults write com.apple.finder CreateDesktop -bool FALSE;killall Finder"
else
do shell script "defaults delete com.apple.finder CreateDesktop;killall Finder"
end if
@majman
majman / notes.html
Last active August 29, 2018 21:43 — forked from dankantor/notes.html
Save notes to localStorage
<html>
<head></head>
<body>
<div id="c" contenteditable style="min-height:100vh;outline:none;" tabindex="0"></div>
<script type="text/javascript">
let div = document.querySelector('#c');
let timeout;
let ls = localStorage.getItem('text') || '';
ls = '<br><br>' + ls; // why do you need those br's - need something to actually click?
div.innerHTML = ls;
@majman
majman / react-classes.js
Created May 10, 2018 18:11
react classssses
// Functional Components: Props Below
const MyFunctionalComponent = ({ text, className, ...props }) => (
<div {...props}
className={classNames('my-functional-component', className)} >
{text}
</div>
);
MyFunctionalComponent.propTypes = {
/** Text to render */
@majman
majman / _$.js
Created September 27, 2016 15:30
jq & underscore bookmaklet
javascript:(function(){var s=document.createElement('script');s.setAttribute('src','https://code.jquery.com/jquery-2.1.1.min.js');s.setAttribute('type','text/javascript');document.getElementsByTagName('head')[0].appendChild(s);jQuery.noConflict();s=document.createElement('script');s.setAttribute('src','https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js');s.setAttribute('type','text/javascript');document.getElementsByTagName('head')[0].appendChild(s);})();
@majman
majman / index.js
Created July 8, 2016 19:22 — forked from max-mapper/index.js
requirebin sketch
var Clarifai = require('clarifai');
Clarifai.initialize({
'clientId': {clientId},
'clientSecret': {clientSecret}
});
function imageToDataUrl(url){
return new Promise(function(resolve, reject) {
var img = new Image();
@majman
majman / index.js
Created July 8, 2016 19:22 — forked from max-mapper/index.js
requirebin sketch
var Clarifai = require('clarifai');
Clarifai.initialize({
'clientId': {clientId},
'clientSecret': {clientSecret}
});
function imageToDataUrl(url){
return new Promise(function(resolve, reject) {
var img = new Image();
alert('test');
@majman
majman / css-grid.less
Last active January 20, 2016 13:24
simple css grid
@base-grid: @container-xl/9; // 132px
@sub-grid: @base-grid/3;
.show-grid {
background: linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px),
linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px),
linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px),
linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px);
background-size:
@sub-grid @sub-grid, @sub-grid @sub-grid,
@base-grid @base-grid, @base-grid @base-grid;
@majman
majman / .phoenix.js
Created October 22, 2015 19:23
config for phoenix window manager
// Forked originally from @JasonM23’s config in literate coffee-script
// https://github.com/jasonm23/Phoenix-config/blob/master/Phoenix-config.litcoffee
// Released under MIT license - http://opensource.org/licenses/MIT
var forApp, key_binding, layouts, mash,
moveWindowLeftOneColumn, moveWindowRightOneColumn, moveWindowToNextScreen,
switchLayout,
windowDownOneRow, windowGrowOneGridColumn, windowGrowOneGridRow, windowShrinkOneGridColumn,
windowShrinkOneGridRow, windowToFullHeight, windowUpOneRow;
@majman
majman / random-playlist-title.js
Last active September 16, 2015 18:56
random-playlist-title.js
// tracks that make up a given playlist
var playlistTracks = [...];
// store possible words in an array
var dictionary = [];
// loop though tracks and add words to dictionary
for(var i = 0; i < playlistTracks.length; i++){
var track = playlistTracks[i];