Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

arvi

🎯
Focusing
  • Laguna, Philippines
View GitHub Profile
@jonlabelle
jonlabelle / npm_vs_yarn_command_translation_cheatsheet.md
Last active Nov 20, 2021
npm vs yarn command translation cheat sheet
View npm_vs_yarn_command_translation_cheatsheet.md
@cayasso
cayasso / index.js
Created May 30, 2017
Bulk writes in mongoose
View index.js
const mongoose = require('mongoose')
const { Types, Schema } = mongoose
// Connect to mongo
mongoose.connect('mongodb://localhost/bulk');
// Set model schema
const ArticleSchema = new Schema({
title: {
type: String,
@amboutwe
amboutwe / wordpress_robots_custom.php
Last active Nov 24, 2021
Filters and example code for Yoast SEO robots or WP robots.txt
View wordpress_robots_custom.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/*
* Replace Disallow with Allow Generated Robots.txt
* Credit: Unknown
* Last Tested: June 09 2020 using WordPress 5.4.1
*/
add_filter('robots_txt','custom_robots');
@vikas5914
vikas5914 / log.js
Last active May 4, 2021
Custom Logger Library with winston
View log.js
const { createLogger, format, transports } = require('winston')
const moment = require('moment')
// set default log level.
const logLevel = 'info'
var logger = createLogger({
level: logLevel,
levels: {
fatal: 0,
@NightlyNexus
NightlyNexus / OkHttpStack.java
Created May 13, 2016
OkHttp 3 implementation of Volley's HttpStack
View OkHttpStack.java
/*
* Copyright (C) 2016 Eric Cochran
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@anggadarkprince
anggadarkprince / AppHelper.java
Last active Nov 8, 2021
Upload file with Multipart Request Volley Android
View AppHelper.java
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import java.io.ByteArrayOutputStream;
/**
* Sketch Project Studio
* Created by Angga on 12/04/2016 14.27.
*/
public class AppHelper {
@beilly
beilly / OkHttp3Stack.java
Last active Feb 13, 2017
Volley Stack with OkHttp3,and it will trusting all certificates. You can remove "allowAllSSLOkHttp(builder);" if you do't want to trusting all.
View OkHttp3Stack.java
package com.benli.app.utils.net;
import com.android.volley.AuthFailureError;
import com.android.volley.Request;
import com.android.volley.toolbox.HttpStack;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.ProtocolVersion;
import org.apache.http.StatusLine;
@dionysius
dionysius / Instructions.md
Last active Oct 7, 2021
Setup launcher icon (.desktop file) for AMPPS. Tested for elementaryOS freya, but should work with most ubuntu derivates.
View Instructions.md

Fix/Create AMPPS Launcher icon (.desktop file)

Install AMPPS with default options (at this time of writing there are no options). Expecting it is installed in /usr/local/ampps/*

Since its important to place the new files at specific locations, you need to adapt the filename as requested. All files are owned by root.

ampps_starter: place this file exactly as /usr/local/bin/ampps and make it executable

ampps_bootstrapper:

@junxie6
junxie6 / PersistentCookieStore.java
Last active Nov 11, 2016 — forked from lezorich/PersistentCookieStore.java
Android basic persistent cookie manager for Volley. This cookie store wraps the default CookieManager store to store the session cookie. It use's Gson to json serialize the cookie and store it as a json string in SharedPreferences.
View PersistentCookieStore.java
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 Lukas Zorich
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
View graphql-nested-schema-example
1. Build GraphQL server using `express-graphql` package.
2. Configure `schema.js` file.
3. Query for data.