Skip to content

Instantly share code, notes, and snippets.

@hrishikesh-mishra
hrishikesh-mishra / QuickSortUsingTailRecursion.java
Created April 15, 2017 15:42
Quick Sort Using Tail Recursion
package com.hrishikesh.practices.sort;
import java.util.Arrays;
/**
* Problem:
* Quick Sort Using Tail Recursion
*
* @author hrishikesh.mishra
*/
@MrTrustor
MrTrustor / clean-docker-for-mac.sh
Last active November 21, 2023 11:38
This script cleans the Docker.qcow2 file that takes a lot of disk space with Docker For Mac. You can specify some Docker images that you would like to keep.
#!/bin/bash
# Copyright 2017 Théo Chamley
# 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 furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or
@fchollet
fchollet / classifier_from_little_data_script_3.py
Last active July 23, 2024 16:32
Fine-tuning a Keras model. Updated to the Keras 2.0 API.
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
@baraldilorenzo
baraldilorenzo / readme.md
Last active June 13, 2024 03:07
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman

# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
@RuiAAPeres
RuiAAPeres / gist:11402456
Last active August 29, 2015 14:00
Sam Page's SparkRecording Implementation with Facebook's Pop
//The calculations are coming from [here](https://gist.github.com/d-ronnqvist/11266321) (thanks David!)
- (void)updateAnimations
{
CGFloat duration = self.duration * (1.f - [[self.progressLayers firstObject] strokeEnd]);
CGFloat strokeEndFinal = 1.f;
for (CAShapeLayer *progressLayer in self.progressLayers)
{
POPBasicAnimation *popEndAnimation = [POPBasicAnimation animation];
@kharmabum
kharmabum / tappable-nav-bar.m
Last active July 20, 2016 15:17
Tappable title view UINavigationBar
#pragma mark - UIGestureRecognizerDelegate
// Toggle mode through touch gesture on navigation bar
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
{
return (self.navigationController.visibleViewController == self &&
(ABS([touch locationInView:self.navigationController.navigationBar].x - self.navigationController.navigationBar.width/2) < 50));
}
- (void)viewWillAppear:(BOOL)animated {

Install cask that extends the brew command :

brew install phinze/cask/brew-cask

Install calibre using cask :

brew cask install calibre
@magicshui
magicshui / tsji.py
Last active December 31, 2015 19:58
字数统计
#!/usr/bin/python
# -*- coding: utf-8 -*-
# 分别统计中文和英文的字数,不包括标点符号。
# Author: Pan Junyong from zopen.cn, panjy at zopen dot cn
import re
import sys
from types import StringType
import operator
import urllib2
@jonathandixon
jonathandixon / .gitignore
Last active January 5, 2021 22:01
Cordova CLI project .gitignore and helper script. Useful when you don't want to commit the platforms and plugins directories to version control. http://stackoverflow.com/q/17911204/417568
platforms/
plugins/