Skip to content

Instantly share code, notes, and snippets.

View assadk88's full-sized avatar

Assad Khan assadk88

View GitHub Profile
@assadk88
assadk88 / babel-webpack.md
Created June 1, 2020 17:31 — forked from ncochard/babel-webpack.md
The correct way to compile ES6 using babel...

When you create a npm package, remember it might be used in a browser or a server, or even a command line utility… For each package you create, please pay attention at what it will be used for:

  1. Is it going to be used as a dependency to a nodejs application that is not bundled? (e.g. command line utilities)
  2. Is it going to be used as a dependency to a nodejs application that is bundled? (e.g. AWS Lambdas)
  3. Is it going to be used as a dependency to a browser application (always bundled)?.
  • In cases 2) and 3) you want to allow for tree shaking.
  • In cases 1) and 2) you want to benefit from the "ES6"/"ES next" features supported natively by nodejs.
  • In case 3) you also want to benefit from the native support of "ES6" from your browser.
@assadk88
assadk88 / README.md
Created May 10, 2020 15:43 — forked from Tynael/README.md
How to use npx to run gist based scripts
@assadk88
assadk88 / osx-for-hackers.sh
Created October 6, 2019 00:50 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@assadk88
assadk88 / drop-to-irb.rb
Created October 5, 2019 16:50 — forked from mkhl/drop-to-irb.rb
Collection of IRB tricks
require 'irb'
module IRB
def self.start_session(binding)
IRB.setup(nil)
workspace = WorkSpace.new(binding)
if @CONF[:SCRIPT]
irb = Irb.new(workspace, @CONF[:SCRIPT])
@assadk88
assadk88 / irbrc
Created October 5, 2019 16:49 — forked from apeiros/irbrc
First draft of my rewritten irbrc - use with caution...
# encoding: utf-8
if defined?(Encoding) then
Encoding.default_external = 'utf-8'
Encoding.default_internal = 'utf-8'
else
$KCODE = 'utf-8'
end
ENV["LANG"] = 'en_US.UTF-8'
@assadk88
assadk88 / 00-about-search-api-examples.md
Created October 4, 2019 22:54 — forked from jasonrudolph/00-about-search-api-examples.md
5 entertaining things you can find with the GitHub Search API
@assadk88
assadk88 / weird_case
Created August 1, 2019 15:01
weirdcase
def weirdcase(string)
#TODO
array = string.split(" ")
if array.size > 0
array.each { |word|
word.each_char{ |char|
if word.index(char).even?
word[index] = letter.upcase
end
}
@assadk88
assadk88 / question_3.rb
Created July 28, 2019 21:10
chapter-6--master-quiz-q3
# Write an adventure game that the player plays from the command line
# by typing in the commands `north` and `south`. The game should have
# this behaviour:
# * Two rooms: a passage and a cave.
# * Passage commands
# * `north`: `puts`es `You are in a scary cave.`
# * Cave commands
# * `south`: `puts`es `You are in a scary passage.`
# * `north`: `puts`es 'You walk into sunlight.` and the program
# stops executing.