Skip to content

Instantly share code, notes, and snippets.

View jasim's full-sized avatar

Jasim A Basheer jasim

View GitHub Profile
s-cork / indentation_guides.ts
Last active July 23, 2022 13:01
Codemirror 6 indentation guides
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 /
Last active April 23, 2022 22:37
My Favorite Mac Tweaks

Skip verifying disk images

defaults write skip-verify true

Always hide the Desktop

defaults write CreateDesktop false; killall Finder

Make terminal logins fast

touch ~/.hushlogin

Disable most animations

@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 /
Last active January 23, 2023 15:48
How to upload a file with $.ajax to AWS S3 with a pre-signed url

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 :).

// make a "base" component
const FakeButton = (props) => (
cursor: 'default',
border: '1px solid',
borderRadius: '3px',
ohanhi /
Last active May 6, 2024 05:17
Learning FP the hard way: Experiences on the Elm language

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 /
Last active March 5, 2024 12:57
Uploading to S3 in 18 lines of Shell (used to upload builds for
# 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 (
# Based on a modified script from here:
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
edgahan / gist:7023047
Created October 17, 2013 11:05
Allows angular templates to reload
class Sprockets::DirectiveProcessor
# This is basically copied from
def process_depend_on_tree_directive(path = ".")
if relative?(path)
root = pathname.dirname.join(path).expand_path
unless (stats = stat(root)) &&
raise ArgumentError, "depend_on_tree argument must be a directory"