Skip to content

Instantly share code, notes, and snippets.

Avatar

Jasim A Basheer jasim

View GitHub Profile
@s-cork
s-cork / indentation_guides.ts
Last active Jul 23, 2022
Codemirror 6 indentation guides
View indentation_guides.ts
import { RangeSetBuilder } from "@codemirror/state";
import { Extension } from "@codemirror/state";
import { Decoration, DecorationSet, EditorView, ViewPlugin, ViewUpdate, WidgetType } from "@codemirror/view";
export function indentationGuides(): Extension {
return [ViewPlugin.fromClass(IndentationGuides, { decorations: (v) => v.decorations }), indentationTheme];
}
// markers can be used at positions on a line over a range
const indentationMark = Decoration.mark({ class: "cm-indentation-guide" });
@koenbok
koenbok / mac-tweaks.md
Last active Apr 23, 2022
My Favorite Mac Tweaks
View mac-tweaks.md

Skip verifying disk images

defaults write com.apple.frameworks.diskimages skip-verify true

Always hide the Desktop

defaults write com.apple.finder CreateDesktop false; killall Finder

Make terminal logins fast

touch ~/.hushlogin

Disable most animations

View css-breakpoint-mixins.scss
@mixin for-phone-only {
@media (max-width: 599px) { @content; }
}
@mixin for-tablet-portrait-up {
@media (min-width: 600px) { @content; }
}
@mixin for-tablet-landscape-up {
@media (min-width: 900px) { @content; }
}
@mixin for-desktop-up {
@guumaster
guumaster / 00-README.md
Last active May 20, 2022
How to upload a file with $.ajax to AWS S3 with a pre-signed url
View 00-README.md

Upload a file with $.ajax to AWS S3 with a pre-signed url

When you read about how to create and consume a pre-signed url on this guide, everything is really easy. You get your Postman and it works like a charm in the first run.

Then you open your browser, try your usual $.ajax() and send your PUT operation, and you hit the cold iced wall of AWS error message, a simple <Code>SignatureDoesNotMatch</Code> that will steal hours from your productivity.

So here I come to save you and give you a free working example of how to upload a file directly to AWS S3 from your browser. You are wellcome :).

View gist:d18ada55ef8d7c4929bb
// make a "base" component
const FakeButton = (props) => (
<div
{...props}
style={{
cursor: 'default',
border: '1px solid',
borderRadius: '3px',
...props.style
}}
@ohanhi
ohanhi / frp.md
Last active Apr 22, 2022
Learning FP the hard way: Experiences on the Elm language
View frp.md

Learning FP the hard way: Experiences on the Elm language

by Ossi Hanhinen, @ohanhi

with the support of Futurice 💚.

Licensed under CC BY 4.0.

Editorial note

@chrismdp
chrismdp / s3.sh
Last active Jun 1, 2022
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
View s3.sh
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@edgahan
edgahan / gist:7023047
Created Oct 17, 2013
Allows angular templates to reload
View gist:7023047
class Sprockets::DirectiveProcessor
# This is basically copied from https://github.com/sstephenson/sprockets/blob/master/lib/sprockets/directive_processor.rb#L289
def process_depend_on_tree_directive(path = ".")
if relative?(path)
root = pathname.dirname.join(path).expand_path
unless (stats = stat(root)) && stats.directory?
raise ArgumentError, "depend_on_tree argument must be a directory"
end