Skip to content

Instantly share code, notes, and snippets.

View arvi's full-sized avatar
🎯
Focusing

arvi

🎯
Focusing
View GitHub Profile
@jonlabelle
jonlabelle / npm_vs_yarn_command_translation_cheatsheet.md
Last active April 11, 2024 15:26
npm vs yarn command translation cheat sheet
@cayasso
cayasso / index.js
Created May 30, 2017 20:10
Bulk writes in mongoose
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 March 20, 2024 15:22
Filters and example code for Yoast SEO robots or WP robots.txt
<?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 December 12, 2023 14:09
Custom Logger Library with winston
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 21:27
OkHttp 3 implementation of Volley's HttpStack
/*
* 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 May 2, 2023 22:39
Upload file with Multipart Request Volley Android
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 February 13, 2017 08:47
Volley Stack with OkHttp3,and it will trusting all certificates. You can remove "allowAllSSLOkHttp(builder);" if you do't want to trusting all.
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 September 13, 2022 13:16
Setup launcher icon (.desktop file) for AMPPS. Tested for elementaryOS freya, but should work with most ubuntu derivates.

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 November 11, 2016 03:08 — 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.
/*
* 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
1. Build GraphQL server using `express-graphql` package.
2. Configure `schema.js` file.
3. Query for data.