Skip to content

Instantly share code, notes, and snippets.

View puncoz's full-sized avatar
🇳🇵
Working from home

Puncoz Nepal puncoz

🇳🇵
Working from home
View GitHub Profile
  1. Open Automator.app
  2. Create new Quick Action
  3. Select Run AppleScript
  4. Add this:
set inputVolume to input volume of (get volume settings)
if inputVolume = 0 then
	set inputVolume to 100
	display notification "Volume set to 100" with title "✅ Microphone is on"
@puncoz
puncoz / gh-pages-deploy.md
Created December 1, 2019 16:40 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@puncoz
puncoz / gist:44f8e95e6881856f8104ab2dfb8903a1
Created October 29, 2019 11:41 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@puncoz
puncoz / gitflow-breakdown.md
Created April 2, 2019 08:08 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@puncoz
puncoz / deploy.rb
Created January 18, 2019 10:44 — forked from tjhanley/deploy.rb
Capistrano task for creating a change log file
desc "Create about and revision files."
task :rev_deployment, :roles => [:app, :web] do
require 'grit'
require 'chronic'
# include Grit
work_dir = File.join(File.dirname(__FILE__), '../../')
g = Grit::Repo.new(work_dir)
since = Chronic.parse('last week friday')
msg = "\n"
rev_file = File.join(File.dirname(__FILE__), '../../','tmp/revision.txt')
@puncoz
puncoz / critical-css-laravel-mix.js
Created September 18, 2018 04:52 — forked from bayareawebpro/critical-css-laravel-mix.js
Generate Critical CSS Paths with Laravel Mix
let mix = require('laravel-mix');
let httpRequest = require('request')
let criticalCSS = require('critical')
//Run your asset compilation commands...
//Then we will generate critical css...
mix.then(()=>{
console.log("Build Post-Processing...")
const criticalRoutes = [
@puncoz
puncoz / file.php
Created June 12, 2018 17:10 — forked from bainternet/file.php
a Simple class to convert number to words in php based on http://www.karlrixon.co.uk/writing/convert-numbers-to-words-with-php/
<?php
//simple class to convert number to words in php based on http://www.karlrixon.co.uk/writing/convert-numbers-to-words-with-php/
if ( !class_exists('NumbersToWords') ){
/**
* NumbersToWords
*/
class NumbersToWords{
public static $hyphen = '-';
public static $conjunction = ' and ';
@puncoz
puncoz / gist:22f2c52a9c506ebb50dc922bfe2b72dd
Created October 29, 2017 16:36 — forked from nostah/gist:d610459d50564c729c56
php swagger 2.0 api sample
<?php
use Swagger\Annotations as SWG;
/**
* @SWG\Swagger(
* basePath="/v1",
* host="api.local",
* schemes={"http"},
* produces={"application/json"},
@puncoz
puncoz / .gitlab-ci.yml
Created June 28, 2017 08:46 — forked from timilsinabishal/.gitlab-ci.yml
Gitlab CI file for continous deployment using capistrano
image: ruby:latest
before_script:
- which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
- eval $(ssh-agent -s)
- ssh-add <(echo -e "$SSH_PRIVATE_KEY")
- gem install capistrano
stages:
- deploy
@puncoz
puncoz / map.choropleth.nepal.R
Created April 30, 2017 13:59 — forked from anjesh/map.choropleth.nepal-updated.R
Step-by-step plotting choropleth map of Nepal
library(rgdal)
library(ggplot2)
library(dplyr)
# clone NepalMaps from https://github.com/anjesh/NepalMaps
# read shapefile
nepal.adm3.shp <- readOGR(dsn="./NepalMaps/baselayers/NPL_adm", layer="NPL_adm3", stringsAsFactors = FALSE)
# fortify shapefile data to data frame