Skip to content

Instantly share code, notes, and snippets.

View codeasashu's full-sized avatar
🌊
Waiting to sail

ashutosh chaudhary codeasashu

🌊
Waiting to sail
View GitHub Profile
@codeasashu
codeasashu / docker-compose.yml
Created July 10, 2017 23:35
Nginx php-fpm mysql phpmyadmin
front:
image: dydx/alpine-nginx-phpfpm
ports:
- "80:80"
volumes:
- ./www:/var/www/default/public
- ./sites:/etc/nginx/sites-enabled
links:
- mysql:mysql
phpmyadmin:
@codeasashu
codeasashu / mongo_useful.md
Created November 10, 2017 08:51
MongoDB useul queries

This assumes we have following schema:

  1. Schema for Messages:
mongoose.Schema({
    user: String,
    content: String,
    creation_time: Date,
    to: String,
    chat: mongoose.Schema.Types.ObjectId,
    read: Boolean
  1. Create Desktop entry
cat > ~/.local/share/applications/Robo3t.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
Name=Robot3t
Exec=mongov
Icon=/opt/robo3t-1.1.1-linux-x86_64-c93c6b0/icon.png
Terminal=false
Type=Application
@codeasashu
codeasashu / libraries.txt
Created January 13, 2018 16:51
Some open source cool libraries and deps
# For Invoices:
PHP Ninja
@codeasashu
codeasashu / shouldknow.txt
Last active January 13, 2018 21:16
JS Know to
1. What are closures. When and why to use closures?
2. Search stackoverflow.com for wikis/contributions on recent JS topics such as ES6, Arrays etc.
https://stackoverflow.com/questions/tagged/ecmascript-6
https://stackoverflow.com/questions/tagged/javascript
https://stackoverflow.com/questions/tagged/vue.js
https://stackoverflow.com/questions/948358/adding-custom-functions-into-array-prototype#comment15037097_948379
JS Falsey values: https://stackoverflow.com/a/4686608/1136491
3. must know basic concepts. Go through "you-don't-know-JS"
4. Learn to setup webpack / gulp+babel+browseify.
5. Start learning Mocha/Karma/Nightowl test runners. Should know E2E, Unit and Integration testing
1. issue this command: sudo ./certbot-auto certonly --manual -d example.com
@codeasashu
codeasashu / Dockerfile
Created February 21, 2018 06:56
Github page jekyll dockerfile
FROM ruby:2.1
MAINTAINER graham@grahamc.com
RUN rm -rf site/Gemfile.lock
RUN apt-get update \
&& apt-get install -y \
node \
python-pygments \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/
@codeasashu
codeasashu / slug-generator.php
Created June 4, 2018 13:35
Generate Slugs based on titles
function createSlug($title = null, $id = 0)
{
$maxTries = 10; // Max recursion limit
if(!$title) {
throw new \Exception('Please mention title to generate the slug');
}
// Normalize the title
$slug = str_slug($title);
@codeasashu
codeasashu / kubelet.log
Created October 26, 2018 19:46
Kubelet failed log
-- Logs begin at Tue 2018-08-14 23:41:29 IST, end at Sat 2018-10-27 04:53:26 IST. --
Oct 27 00:51:23 server systemd[1]: Started Kubernetes Kubelet Server.
Oct 27 00:51:23 server kubelet[1495]: Flag --address has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/adminis>
Oct 27 00:51:23 server kubelet[1495]: Flag --allow-privileged has been deprecated, will be removed in a future version
Oct 27 00:51:23 server kubelet[1495]: Flag --cgroup-driver has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/a>
Oct 27 00:51:23 server kubelet[1495]: Flag --fail-swap-on has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/ad>
Oct 27 00:51:23 server kubelet[1495]: Usage:
Oct 27 00:51:23 server kubelet[1495]: kubelet [flags]
Oct 27 00:51:23