Skip to content

Instantly share code, notes, and snippets.

@sxwebdev
sxwebdev / golang_job_queue.md
Created July 11, 2020 22:21 — forked from harlow/golang_job_queue.md
Job queues in Golang
@sxwebdev
sxwebdev / Dockerfile
Created May 24, 2020 23:15 — forked from rizo/Dockerfile
Alpine (3.6) based docker image with Protocol Buffers compiler supporting Go.
# Protobuf Builder
# ================
#
# This image builds protocol buffers library from source with Go generation
# support. The builder and runner images are produced.
# Builder Image
# -------------
FROM golang:1.8.3-alpine3.6 as builder
@sxwebdev
sxwebdev / medianHeap.java
Created September 30, 2019 13:21
Java algorithm to get the running median for an array of integer.
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
/**
* The add number method
*/
@sxwebdev
sxwebdev / gist:fb82be7b783a34dddcfd186a8b3d335e
Created August 24, 2018 21:28 — forked from sabarasaba/gist:3080590
Remove directory from remote repository after adding them to .gitignore
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@sxwebdev
sxwebdev / webpack.config.dev.js
Created August 24, 2018 06:17
add jquery to webpack
plugins: [
new webpack.ProvidePlugin({
$: "jquery/dist/jquery.min.js",
jQuery: "jquery/dist/jquery.min.js",
"window.jQuery": "jquery/dist/jquery.min.js"
})
];
@sxwebdev
sxwebdev / LICENCE SUBLIME TEXT
Created August 12, 2018 20:53
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 -----
@sxwebdev
sxwebdev / Sublime.User.Settings.json
Created July 4, 2018 22:50
Sublime Text 3 User Settings
{
"detect_indentation": false,
"fallback_encoding": "Cyrillic (Windows 1251)",
"font_size": 12,
"ignored_packages":
[
"Vintage"
],
"update_check": false,
"show_definitions": false
@sxwebdev
sxwebdev / console_log.sublime-snippet
Created March 30, 2018 03:56
console_log.sublime-snippet
<snippet>
<content><![CDATA[console.log($1);$0]]></content>
<tabTrigger>clog</tabTrigger>
<scope>text.html,source.js,source.js.jsx</scope>
<description>console.log()</description>
</snippet>
@sxwebdev
sxwebdev / tab-trigger.js
Last active March 30, 2018 03:43 — forked from wesbos/tab-trigger.js
How to properly get a TAB trigger working with Emmet inside of JSX
{
"keys": ["tab"],
"command": "expand_abbreviation_by_tab",
// put comma-separated syntax selectors for which
// you want to expandEmmet abbreviations into "operand" key
// instead of SCOPE_SELECTOR.
// Examples: source.js, text.html - source
"context": [
{
@sxwebdev
sxwebdev / calculate_ds.js
Last active December 6, 2017 17:26
Calculate distance and speed by latitude and longitude. es6 javascript
const calculate_ds = (lat1, lon1, lat2, lon2, timestamp1, timestamp2) => {
lat1 = lat1 * Math.PI / 180.0;
lon1 = lon1 * Math.PI / 180.0;
lat2 = lat2 * Math.PI / 180.0;
lon2 = lon2 * Math.PI / 180.0;
const r = 6378100;