Skip to content

Instantly share code, notes, and snippets.

View Dshosev's full-sized avatar
🤘
I came i saw i conquered!

Josef Unger Dshosev

🤘
I came i saw i conquered!
View GitHub Profile
@Dshosev
Dshosev / httpStore.js
Created March 7, 2022 02:09 — forked from joshnuss/httpStore.js
A Svelte store backed by HTTP
import { writable } from 'svelte/store'
// returns a store with HTTP access functions for get, post, patch, delete
// anytime an HTTP request is made, the store is updated and all subscribers are notified.
export default function(initial) {
// create the underlying store
const store = writable(initial)
// define a request function that will do `fetch` and update store when request finishes
store.request = async (method, url, params=null) => {
@Dshosev
Dshosev / .bashrc
Created January 15, 2022 14:47 — forked from vsouza/.bashrc
Golang setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell, fish or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@Dshosev
Dshosev / .bashrc
Created January 15, 2022 14:47 — forked from vsouza/.bashrc
Golang setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell, fish or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@Dshosev
Dshosev / gradientActionbarIosNativeScript.js
Created January 29, 2020 13:13 — forked from shiv19/gradientActionbarIosNativeScript.js
use this code with loaded event of a page to get gradient actionbar on iOS for NativeScript Apps
import { Frame } from 'tns-core-modules/ui/frame';
import { Color } from 'tns-core-modules/color';
import { isIOS } from 'tns-core-modules/platform';
declare var CAGradientLayer, CGPointMake, UIGraphicsBeginImageContext, UIGraphicsGetCurrentContext;
declare var UIGraphicsGetImageFromCurrentImageContext, UIBarMetrics, CGSizeMake;
export function onActionBarLoaded(args) {
if (isIOS) {
const navigationBar = Frame.topmost().ios.controller.navigationBar;