Skip to content

Instantly share code, notes, and snippets.

View ylogx's full-sized avatar
🤘
<div><ståtús/></div>

Shubham Chaudhary ylogx

🤘
<div><ståtús/></div>
View GitHub Profile
@chkumar246
chkumar246 / pypune2015sprint.rst
Last active March 15, 2016 11:29
Python Pune sprint 2015 project list.
@ylogx
ylogx / load_and_cache.py
Created July 21, 2016 12:56
Load a dataset and cache it for further calls
import numpy as np
import pickle
def load_and_cache(filename):
output = None
cache_dir = '/tmp/my_project_cache/'
os.makedirs(cache_dir, mode=0o744, exist_ok=True)
cache = cache_dir + filename + '.pkl'
if not os.path.exists(cache):
output = np.genfromtxt(filename, dtype=float, delimiter=',') # TODO: Fill your logic
@ylogx
ylogx / zomato_bookmarklet.js
Last active September 26, 2018 06:24
A bookmarklet to find various zomato resource properties. To use, copy this code and paste it in URL field of a new bookmark.
javascript: void
function($) {
var loadBookmarklet = function($) {
(function() {
if ("www.zomato.com" == document.domain) {
var msg = "";
try {
splits = $('meta[property="al:android:url"]').attr("content").split("/");
const id = splits[3],
page_type = splits[2];
package org.paulbetts.shroom.core;
import android.os.AsyncTask;
import com.squareup.okhttp.*;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.Arrays;
@peterkuma
peterkuma / server.py
Created February 10, 2014 14:22
A flask server for serving all JPEG images in a local directory and subdirectories. Uses unveil.js for lazy-loading of images. Thumbnails are created on the fly by PIL.
#!/bin/python
import os
from flask import Flask, Response, request, abort, render_template_string, send_from_directory
import Image
import StringIO
app = Flask(__name__)
WIDTH = 1000
@vmarkovtsev
vmarkovtsev / notebook.ipynb
Created March 10, 2017 10:40
lapjv blog post
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@foklepoint
foklepoint / .gitlab-ci.yml
Created July 8, 2017 20:25
Build and Push images to GCP Container Registry with Gitlab CI
image: docker:latest
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
variables:
DOCKER_DRIVER: overlay
GCP_PROJECT_ID: CHANGE-TO-GCP-PROJECT-ID
IMAGE_NAME: image_id
services:
@swankjesse
swankjesse / OkHttpBug.java
Created February 21, 2016 16:45
Sample bug report for OkHttp
import okhttp3.Call;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import okhttp3.mockwebserver.RecordedRequest;
import org.junit.Rule;
import org.junit.Test;
import okhttp3.ResponseBody;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import okhttp3.mockwebserver.RecordedRequest;
import org.junit.Rule;
import org.junit.Test;
import retrofit2.Call;
import retrofit2.Response;
import retrofit2.Retrofit;
import retrofit2.http.GET;
@dikiaap
dikiaap / git-io-custom-url.md
Last active August 5, 2023 04:21
git.io custom URL

Update: As of 11 January 2022, git.io no longer accepts new URLs.

Command:

curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"

URLs that can be created is from:

  • https://github.com/*
  • https://*.github.com