This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Finder" | |
set p to path to desktop -- Or whatever path you want | |
make new folder at p with properties {name:"New Folder"} | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach ($array as &$item) { | |
// code | |
} | |
unset($item); | |
foreach ($array as $key => $value) { | |
// code | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var discreteElements = document.getElementsByClassName('animate-this') | |
for (var i = 0; i < discreteElements.length; i++) { | |
new Waypoint({ | |
element: discreteElements[i], | |
handler: function() { | |
this.element.classList.add("top-50pfrom-topOfWindow"); | |
}, | |
// context: document.getElementById('page-content'), | |
offset: '50%' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Finder" | |
try | |
set fileName to "eeee" | |
if length of fileName = 0 then | |
return 0 | |
end if | |
set fileExt to "txt" | |
set thisFolder to "Macintosh HD:Users:csilverman:Dropbox:dev:Local Sites:csiprojects:app:public:playlists:assets:links" | |
-- the target of the front window as alias |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- H.Zimmerman, AppleScript. | |
-- Create text file in current Finder folder with a dialog. | |
tell application "Finder" | |
try | |
display dialog "name of doc please (without the .txt thing)" default answer "" | |
set fileName to the text returned of result | |
if length of fileName = 0 then | |
return 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function slugify($string){ | |
// /[^A-Za-z0-9-]+/ | |
// $final_string = strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $string), '-')); | |
// Get rid of multiple spaces | |
$final_string = str_ireplace(' ', ' ', $string); | |
// target all alphanumerics | |
// https://stackoverflow.com/a/17947853/6784304 | |
$replace_pattern = '/\W|_/'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.4.25) | |
// Compass (v1.0.3) | |
// ---- | |
$breakpoints: ( | |
small: 34em, | |
medium: 50em, | |
large: 70em | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Here's the problem this is trying to solve. | |
Say an element is supposed to fade in after a Javascript event. It needs to be hidden and then | |
revealed. If JS is off or broken, though, the element will never be revealed. That | |
could be a problem. | |
To solve this, you'd set up a CSS animation that automatically reveals the element after a | |
certain period of time. (You won't know when exactly JS fails, or how long it | |
might take to load - that's the downside. You'd have to hardcode a delay, and | |
then hope that JS loads within that time. I think Typekit's wf-loading did something |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* RSS2INSTA | |
========= | |
This scans a folder of images with specially formatted captions, and generates a generic RSS feed. You can then plug this feed into a Zapier workflow and have it send the images (with tags) to Buffer, which will post them to Instagram. | |
The caption format allows you to specify a plain-language caption as well as whatever hashtags you want to have. The different parts of the caption are delimited by %%, since that seems unlikely to occur in normal text. | |
Captions should be formatted as follows: [ID]%%[caption text]%%[image tags].jpg. |