Skip to content

Instantly share code, notes, and snippets.

View mskian's full-sized avatar
🦕
Focusing

Santhosh Veer mskian

🦕
Focusing
View GitHub Profile
@conormcafee
conormcafee / .htaccess
Last active March 26, 2020 11:49
Jekyll .htaccess for Apache Server
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+)/$ $1.html [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .*[^/]$ %{REQUEST_URI}/ [L,R=301]
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
@heiswayi
heiswayi / repo-reset.md
Created February 5, 2017 01:32
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@wesbos
wesbos / async-await.js
Created February 22, 2017 14:02
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
@michaellihs
michaellihs / strava_cli.md
Last active January 3, 2026 18:39
Upload tracks to Strava from the Command Line

Upload GPS Tracks to Strava from your Command Line

This short tutorial describes how to upload GPS tracks to Strava using your command line interface / shell. It requires no special tools or any 3rd party code.

1. Generate an API Key

Run the following steps with your user logged in to Strava in your browser!

Strava uses OAuth to authenticate against 3rd party applications. In order to authenticate to your Strava account from your command line, you first have to generate an API key. Therefore go to this page https://strava.github.io/api/v3/oauth/ and create a new API. The settings are as follows:

@dexit
dexit / vanilla-api.md
Created April 15, 2018 14:09
Building a Simple Web API with Vanilla PHP
@mskian
mskian / repo-reset.md
Created May 2, 2019 10:24 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A

Vim Commands

Files

  • vi filename.txt - Open a file
  • : - Enter Command Mode
  • u - Undo changes
  • ctrl+u - Redo Changes
  • :q - Quit Vim
  • :q! - Force quit vim without saving
@mcnaveen
mcnaveen / How to Create API Key in Gotify?
Last active December 17, 2021 13:55
How to Create API Key in Gotify?
Well, This tutorial will walk you through creating your First Gotify API Key which helps in setting up your appliation.
Comment contains step by step instruction with image. Check it out.
Thanks.
@seeliang
seeliang / convert-ejs-to-html.js
Last active September 1, 2023 16:09
use node to generate html from ejs file
const ejs = require('ejs');
const fs = require('fs');
module.exports = ({template, config}) => {
fs.readFile(template, 'utf8', (err, data) => {
if (err) { console.log(err); return false; }
var ejs_string = data,
template = ejs.compile(ejs_string),
html = template(config);
fs.writeFile(template.replace('.ejs', '') + '.html', html, (err) => {
if(err) { console.log(err); return false }
@mcnaveen
mcnaveen / n8n docker command.md
Last active April 27, 2023 06:33
Docker Command to Run n8n on Docker Container with Static IP Address

Create Docker Network

docker network create --subnet=172.1.0.0/16 Network Name

Run Docker Container

docker run -d --net NETWORKNAME \
--ip STATICIP \
-it \
--name n8n \