Skip to content

Instantly share code, notes, and snippets.

$(window).scroll(function() {
if ($(window).scrollTop() > 100) {
// > 100px from top - show div
}
else {
// <= 100px from top - hide div
}
});
<!-- HTML heavily inspired by http://blueimp.github.io/jQuery-File-Upload/ -->
<div class="table table-striped" class="files" id="previews">
<div id="template" class="file-row">
<!-- This is used as the file preview template -->
<div>
<span class="preview"><img data-dz-thumbnail /></span>
</div>
<div>
<p class="name" data-dz-name></p>
// Get the template HTML and remove it from the doumenthe template HTML and remove it from the doument
var previewNode = document.querySelector("#template");
previewNode.id = "";
var previewTemplate = previewNode.parentNode.innerHTML;
previewNode.parentNode.removeChild(previewNode);
var myDropzone = new Dropzone(document.body, { // Make the whole body a dropzone
url: "/target-url", // Set the url
thumbnailWidth: 80,
thumbnailHeight: 80,
{
"always_show_minimap_viewport": true,
"auto_complete": false,
"binary_file_patterns":
[
"*.ttf",
"*.tga",
"*.dds",
"*.eot",
"*.pdf",
[
{ "keys": ["ctrl+alt+b"], "command": "open_in_browser" },
{ "keys": ["ctrl+space"], "command": "auto_complete" },
{ "keys": ["ctrl+space"], "command": "replace_completion_with_auto_complete", "context":
[
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
{ "key": "auto_complete_visible", "operator": "equal", "operand": false },
{ "key": "setting.tab_completion", "operator": "equal", "operand": true }
]
},
{
"bootstrapped": true,
"in_process_packages":
[
],
"installed_packages":
[
"AdvancedNewFile",
"Alignment",
"Babel",
@ahmadmilzam
ahmadmilzam / sample.scss
Created April 16, 2017 18:49
SCSS Triangle Mixins
.triangle-top {
@include triangle(top);
}
.triangle-bottom {
@include triangle(bottom);
}
.triangle-left {
@include triangle(left);
}
.triangle-right {
@ahmadmilzam
ahmadmilzam / sublime-user-settings.json
Created April 28, 2017 20:01
My sublime settings
{
// "auto_complete": false,
"auto_complete_commit_on_tab": true,
// Allow auto-complete suggestion within snippets.
"auto_complete_with_fields": true,
"always_show_minimap_viewport": true,
"binary_file_patterns":
[
"*.ttf",
"*.tga",
// parseUri 1.2.2
// (c) Steven Levithan <stevenlevithan.com>
// MIT License
function parseUri (str) {
var o = parseUri.options,
m = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
uri = {},
i = 14;
// remove parent without removing childen
function unwrap(wrapper) {
// place childNodes in document fragment
var docFrag = document.createDocumentFragment();
while (wrapper.firstChild) {
var child = wrapper.removeChild(wrapper.firstChild);
docFrag.appendChild(child);
}
// replace wrapper with document fragment