Skip to content

Instantly share code, notes, and snippets.

View saratonite's full-sized avatar
🏡
WFH

Sarath saratonite

🏡
WFH
View GitHub Profile
@saratonite
saratonite / client.js
Created February 23, 2023 09:04 — forked from mattfysh/client.js
urql + auth-exchange + aws-amplify
import { makeOperation } from '@urql/svelte'
import { authExchange } from '@urql/exchange-auth'
import { Auth } from 'aws-amplify'
import produce from 'immer'
import { set } from 'lodash'
const amplifyAuthExchange = authExchange({
addAuthToOperation: ({ authState, operation }) => {
if (!authState?.token) {
return operation
@saratonite
saratonite / example.png
Created September 20, 2022 06:50 — forked from charlesrt/example.png
Job Posting Standard
example.png
@saratonite
saratonite / download_egghead_videos.md
Created November 21, 2021 15:12 — forked from ldong/download_egghead_videos.md
download egghead videos

Download videos from egghead

Go to the egghead website, i.e. Building a React.js App

run

$.each($('h4 a'), function(index, video){
  console.log(video.href);
});
/* Conditional */
SELECT product_id, language_code, name, custom_name, description, short_description FROM product_translations
WHERE product_id=16741 AND
language_code = SELECT IF ((SELECT COUNT(*) FROM product_translations WHERE product_id=16741), 'es', 'en_US');
/*With Join*/
ELECT DISTINCT pro.product_id, pcr.category_id,pro.product_sku,
@saratonite
saratonite / LICENCE SUBLIME TEXT
Created February 23, 2019 17:26
Sublime Text 3 Serial key build is 3176
## Sublime Text 3 Serial key build is 3176
> * Added these lines into /etc/hosts
127.0.0.1 www.sublimetext.com
127.0.0.1 license.sublimehq.com
> * Used the license key
----- BEGIN LICENSE -----
@saratonite
saratonite / LICENCE SUBLIME TEXT
Created February 23, 2019 17:26
Sublime Text 3 Serial key build is 3176
## Sublime Text 3 Serial key build is 3176
> * Added these lines into /etc/hosts
127.0.0.1 www.sublimetext.com
127.0.0.1 license.sublimehq.com
> * Used the license key
----- BEGIN LICENSE -----
@saratonite
saratonite / Twitter API with Curl
Created February 13, 2018 10:06 — forked from apolloclark/Twitter API with Curl
Twitter API with Curl
# create an account, create an app
# @see https://apps.twitter.com/
# retrieve the access tokens
# @see https://dev.twitter.com/oauth/reference/post/oauth2/token
# create the file ~/twitter_api
nano ~/twitter_api
Authorization: OAuth oauth_consumer_key="XXXXXX", oauth_nonce="11111111", oauth_signature="XXXXXX", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1450728725", oauth_token="99999-XXXXXX", oauth_version="1.0"
@saratonite
saratonite / App.js
Created July 7, 2017 01:26 — forked from fdidron/App.js
React Router v4 Auth
//Usage
import React from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import Route from './AuthRoute';
import Login from './Login';
import Private from './Private';
export default () =>
<Router>
@saratonite
saratonite / aspdotnetcore_set_response_headers.cs
Created May 30, 2017 06:14
ASP.net core set response headers
Result.Content.Headers.Add("Content-Disposition", "attachment; filename=" + FileName);
Result.Content.Headers.Add("Access-Control-Expose-Headers", "filename");
Result.Content.Headers.Add("filename", FileName);
@saratonite
saratonite / angular2_material_select.html
Created May 26, 2017 10:45
Angular 2 Material Select
<md-select class="md-select-custom-style" name="datasourcetype" placeholder="Data Source Type" [(ngModel)]="dataSource.dataSourceTypeId">
<md-option *ngFor="let dsType of dataSourceTypes" [value]="dsType.dataSourceTypeId">{{ dsType.name }}</md-option>
</md-select>