Skip to content

Instantly share code, notes, and snippets.

View dezinezync's full-sized avatar
🏠
Working from home

Nikhil Nigade dezinezync

🏠
Working from home
View GitHub Profile
@dezinezync
dezinezync / seqpromise.js
Created February 9, 2017 08:23
Run N Promises sequentially, irrespective of whether the previous promise passed or failed.
const run = () => +new Date()
let arr = Array.from({length: 100}, run)
arr.reduce((x, y) => {
x.then(result => {
console.log(x)
return y
}, err => {
console.error(err)
@dezinezync
dezinezync / reset.css
Created November 3, 2016 11:44
Modern CSS Reset (UA Style)
// the following is taken from the following tweet
// https://twitter.com/benfrain/status/794138525570580480
* {
all: unset;
}
head {
display: none;
}
@dezinezync
dezinezync / FeedbackGenerator.h
Last active October 13, 2016 05:21
FeedbackGenerator is a generic class that encapsulates UISelectionFeedbackGenerator and UINotificationFeedbackGenerator.
//
// FeedbackGenerator.h
// Esfresco
//
// Created by Nikhil Nigade on 13/10/16.
// Copyright © 2016 Dezine Zync Studios LLP. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

Keybase proof

I hereby claim:

  • I am dezinezync on github.
  • I am dezinezync (https://keybase.io/dezinezync) on keybase.
  • I have a public key ASA8CFYOQ175J1zgsOrtsa0xWi6AMaeasC-s-M9-vM6gsgo

To claim this, I am signing this object:

@dezinezync
dezinezync / inputSupport.js
Created February 4, 2016 09:48
Check for Input type support
// This is an adapted version from http://www.quirksmode.org/blog/archives/2015/03/better_modern_i.html
/**
* Supports Type determines whether the give input type is supported in the browser
* @param {String} type The type to check for. Example: text, date, time, color
* @return {Boolean} Returns true if the input type is supported, false otherwise.
*/
function supportsType(type) {
var input = document.createElement("input")
@dezinezync
dezinezync / app.js
Created February 4, 2016 06:49
Log Line Numbers in NodeJS
// include it in the first file that NodeJS will load
// yes, eval is dangerous, but not when you know exactly what it's loading
var fs = require("fs");
eval(fs.readFileSync(__dirname+'log.js')+'');
// Usage, in say /routes/user.js
console.log(__line, user.userID)
// /routes/user.js:34:22 > 2
@dezinezync
dezinezync / nginx
Created September 26, 2015 12:40
Nginx service script
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemin
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /usr/local/nginx/conf/nginx.conf
# pidfile: /usr/local/nginx/logs/nginx.pid
@dezinezync
dezinezync / gist:25ea31c5b7e012960b08
Last active September 19, 2015 07:52
Fastlane crash
# Fastlane v1.27.0
# gym v0.6.2
[13:17:00]: Successfully exported and compressed dSYM file
[13:17:00]: -------------------
[13:17:00]: --- Step: slack ---
[13:17:00]: -------------------
[13:17:04]: Successfully sent Slack notification
[13:17:04]: Variable Dump:
[13:17:04]: {:DEFAULT_PLATFORM=>:ios, :ENVIRONMENT=>nil, :PLATFORM_NAME=>:ios, :LANE_NAME=>"ios beta", :BUILD_NUMBER=>"35"}
@dezinezync
dezinezync / preboot.less
Last active May 17, 2016 07:21
Preboot
//
// Variables
// --------------------------------------------------
// Grayscale
@black-10: darken(#fff, 10%);
@black-20: darken(#fff, 20%);
@dezinezync
dezinezync / normalize.less
Last active May 17, 2016 07:21
normalize.less
article,
aside,
details,
figcaption,