Skip to content

Instantly share code, notes, and snippets.

View kumarharsh's full-sized avatar
🤹‍♂️
Juggling

Kumar Harsh kumarharsh

🤹‍♂️
Juggling
View GitHub Profile
@gvergnaud
gvergnaud / lazy-list.js
Last active July 31, 2023 23:57
Lazy List, implemented with es6 generators
/* ----------------------------------------- *
Lazy List Implementation
* ----------------------------------------- */
// Haskell-like infinite List, implemented with es6 generators
// Lazyness lets you do crazy stuff like
List.range(0, Infinity)
.drop(1000)
.map(n => -n)
@nodkz
nodkz / apolloServer2019.ts
Last active August 3, 2022 11:17
GraphQL error tracking with sentry.io (ApolloServer 2019)
import express from 'express';
import { ApolloServer } from 'apollo-server-express';
import { ApolloServerPlugin } from 'apollo-server-plugin-base';
import * as Sentry from '@sentry/node';
Sentry.init({
environment: process.env.APP_ENV,
// see why we use APP_NAME here: https://github.com/getsentry/sentry-cli/issues/482
release: `${process.env.APP_NAME}-${process.env.APP_REVISION}` || '0.0.1',
dsn: process.env.SENTRY_DSN,
@houtianze
houtianze / Fixing.Docker.Installation.On.Windows.md
Last active June 3, 2016 14:14
Fixing Docker Toolbox installation on Windows

The following is what I need to do to get Docker working on Windows after a fresh installation of Docker Toolbox (version 1.9.0, latest as the time of writting).

  • Fix the boot2docker VM port mappings using the commands here: https://gist.github.com/houtianze/bbe6d9af9f7e21bf1eef (bascially, map local port 2375 and 2376 to the VM)
  • Copy all the *.pem files from ~\.docker\machine\certs\ to ~\.docker\
  • Copy config.json from ~\.docker\machine\machines\default\ to ~\.docker\ (Btw, the name of the VM default is hardcoded in the script, and config.josn doesn't seem to be read by Docker, see docker/compose#1590 )
  • Create the following 2 environment variables:
    • DOCKER_TLS_VERIFY=1
    • DOCKER_CONFIG=<YOUR HOME DIRECTORY>\.docker
  • Run docker ps to verify that docker is working now
@houtianze
houtianze / Docker.VM.Creation.Tweak.md
Last active June 3, 2016 14:14
Docker VirtualBox VM (boot2docker) creation tweaks (adding in port forwarding, increase vram size)

For Non-Linux OSes (Windows, OS X etc) only, on which an installation of VirtualBox is needed to run Docker.

  • Locate and open file: <Docker Toolbox Installation Direcotry>\start.sh

  • Add in the following lines after $DOCKER_MACHINE create -d virtualbox --virtualbox-memory 2048 --virtualbox-disk-size 204800 $VM

  "${VBOXMANAGE}" modifyvm default --vram 16
  "${VBOXMANAGE}" modifyvm default --natpf1 "http,tcp,127.0.0.1,2375,,2375" 
@pburtchaell
pburtchaell / styles.css
Last active February 25, 2024 12:24
VH and VW units can cause issues on iOS devices. To overcome this, create media queries that target the width, height, and orientation of iOS devices.
/**
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units
*
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
*
* iOS Resolution Quick Reference: http://www.iosres.com/
*/
@LinusU
LinusU / README.md
Last active July 17, 2021 08:06 — forked from apla/icons_and_splash.js
Icons and Splash images for your Cordova project. (with iOS 7 support)

Usage

Install cordova into node_modules

npm install cordova

Add icons_and_splash.js

@dpogorzelski
dpogorzelski / directives.js
Created August 27, 2013 08:16
Twitter share button as AngularJS directive.
directives.directive('twitter', [
function() {
return {
link: function(scope, element, attr) {
setTimeout(function() {
twttr.widgets.createShareButton(
attr.url,
element[0],
function(el) {}, {
count: 'none',
@magnetikonline
magnetikonline / README.md
Last active March 14, 2024 22:48
IE 7/8/9/10/11 Virtual machines from Microsoft - Linux w/VirtualBox installation notes.
@include handhelds {
table.responsive {
width: 100%;
thead {
display: none;
}
tr {
display: block;
}
td, th {