Skip to content

Instantly share code, notes, and snippets.

View adyontech's full-sized avatar
😎
Working on private projects.

Aditya sharma adyontech

😎
Working on private projects.
View GitHub Profile
# How to echobot with XMPP, BOSH, and Strophe
1. Setup ejabberd(http://www.ejabberd.im/) server and setup account [email protected]
NOTE: localhost should be enough. If you setup something else, make sure you add it at /etc/hosts like this
#/etc/hosts
127.0.0.1 localhost.local
NOTE: Also download Psi(http://psi-im.org/), and make sure you can connect to your ejabberd server.
2. Download strophe(http://code.stanziq.com/strophe/) and place it (eg: /Users/makoto/work/sample/strophejs-1.0)
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active November 18, 2024 11:51
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active July 3, 2024 02:22
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@mikaelbr
mikaelbr / destructuring.js
Last active August 20, 2024 11:27
Complete collection of JavaScript destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@vasanthk
vasanthk / System Design.md
Last active November 19, 2024 10:54
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@soderlind
soderlind / class-google-maps-oembed-provider.php
Last active April 29, 2024 11:44
WordPress Google Maps oEmbed Provider using the Google Maps Embed API
<?php
/**
* Create a Google Maps oEmbed Provider using the Google Maps Embed API
*
* @see https://developers.google.com/maps/documentation/embed/
* @link https://gist.github.com/soderlind/db6dae8a73253329bc97ac50d7ebedef
* @since 1.0.0
* @package Google_Maps_oEmbed_Provider
*/
class DSS_oEmbed_Add_Provider {
@tilakpatidar
tilakpatidar / NLP Lab workshop 17th May 2016.md
Last active May 17, 2016 12:44
Resource links for the workshop conducted by NLP lab on 17th May 2016.

#Semantic Search engine – NLP lab

###17/05/2016 Task

http://blog.aiesec.in/

Use the above blog to scrap the following information and show in terminal (ubuntu) or in a file in windows.

@jcouyang
jcouyang / README.org
Last active November 12, 2024 21:37
Promise All with Limit of Concurrent N

The Promise All Problem

in case of processing a very large array e.g. Promise.all(A_VERY_LARGE_ARRAY_OF_XHR_PROMISE)

which would probably blow you browser memory by trying to send all requests at the same time

solution is limit the concurrent of requests, and wrap promise in thunk

Promise.allConcurrent(2)([()=>fetch('BLAH1'), ()=>fetch('BLAH2'),...()=>fetch('BLAHN')])

@rhysburnie
rhysburnie / node-or-browser.js
Last active October 22, 2024 23:28
Detect node or browser
// determine if in-browser or using node.js
// thruthy
var _nodejs = (
typeof process !== 'undefined' && process.versions && process.versions.node);
if (_nodejs) {
_nodejs = {
version: process.versions.node
};
}
@znck
znck / promised.ts
Last active August 14, 2019 15:22
Moved to https://github.com/znck/promised | A utility to convert callbacks to promises.
import {promisify, CustomPromisify} from 'util'
export type FunctionProxy<T extends Function> = CustomPromisify<T>
export type PackageProxy<P extends { [key: string]: Function }> = {
[K in keyof P]: FunctionProxy<P[K]>
}
export function promised<T extends { [key: string]: Function | any }>(target: T): PackageProxy<T> {