Skip to content

Instantly share code, notes, and snippets.

View aravindhkumar23's full-sized avatar

aravindhkumar aravindhkumar23

View GitHub Profile
@aravindhkumar23
aravindhkumar23 / directories
Created February 26, 2015 08:20
python gets folder name and file how to iterate and get the for loop value in dashboard page.--Django
import os
k=[]
l=[]
lis=[]
rootDir = '.'
for dirName, subdirList, fileList in os.walk(rootDir, topdown=False):
# print("dir is " , dirName)
lis=lis+[dirName]
for fname in fileList:
# print("file is " , fname)
@aravindhkumar23
aravindhkumar23 / viewcontroller
Last active May 31, 2016 11:10
Add animation for swipe from left to right -Swift
import UIKit
import QuartzCore
enum CustomSegueAnimation {
case SwipeFromleft
}
// MARK: Segue class
class CustomSegue: UIStoryboardSegue {
@aravindhkumar23
aravindhkumar23 / sort.txt
Created October 18, 2016 11:13
Sorting Array of dictionary with key(Int) eg:[{"name":"value","time":"time"},{}]
sortedarray = storedarray.sort{
(($0 as! Dictionary<String, AnyObject>)["time"] as? Int) < (($1 as! Dictionary<String, AnyObject>)["time"] as? Int)
}
@aravindhkumar23
aravindhkumar23 / findMatch
Created October 20, 2016 13:44
sort dictionary inside array, and find match between 2 array
let loggedIn_array = ((loggedInUserSolution.valueForKey("solutions") as? NSArray ?? NSArray()).sort{
(($0 as? Dictionary<String, String> ?? Dictionary<String, String>())["solution_id"]) < (($1 as? Dictionary<String, String> ?? Dictionary<String, String>())["solution_id"])
}) as NSArray
let opposite_array = ((oppositeUserSolution.valueForKey("solutions") as? NSArray ?? NSArray()).sort{
(($0 as? Dictionary<String, String> ?? Dictionary<String, String>())["solution_id"]) < (($1 as? Dictionary<String, String> ?? Dictionary<String, String>())["solution_id"])
}) as NSArray
print("loggedIn_array ::\(loggedIn_array)")
print("opposite_array ::\(opposite_array)")
@aravindhkumar23
aravindhkumar23 / swipeViewController.swift
Last active November 29, 2016 08:58
carousel view programatically swift includes [collection view, pageControl, with 2 button and 3 labels] swift 2.3
// Swift 2.3 Xcode 7.3.1
import UIKit
class swipeViewController: UIViewController, UICollectionViewDelegateFlowLayout, UICollectionViewDataSource {
let fontName: String = "Aileron-Regular"
let fontSize: CGFloat = 16
var collectionView: UICollectionView!
let layout: UICollectionViewFlowLayout = UICollectionViewFlowLayout()
@aravindhkumar23
aravindhkumar23 / index.ios.js
Last active April 10, 2017 12:38
react-native category subcategory select listview and expand options if exists
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
@aravindhkumar23
aravindhkumar23 / camera_view.dart
Last active March 19, 2021 20:44
Flutter Camera view with + button to open gallery (captured image and gallery picked image will be shown in horizontal scrollable view in bottom like whatsapp)
import 'dart:async';
import 'dart:io';
import 'package:camera/camera.dart';
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'package:path_provider/path_provider.dart';
import '/utils.dart';
@aravindhkumar23
aravindhkumar23 / main.dart
Last active January 9, 2024 07:05
Clipping widgets with bezier curves in Flutter
//access the wavy header in body by below code
return Scaffold(
body: Container(height:200.0,child: new WavyHeader()),
);
//creates a curve with 3 curves merged by using stack
// ref link
https://iirokrankka.com/2017/09/04/clipping-widgets-with-bezier-curves-in-flutter/
@aravindhkumar23
aravindhkumar23 / main.dart
Created May 3, 2019 13:12
Vertical scroll with alphabet scroll - Flutter
import 'package:flutter/material.dart';
import 'package:draggable_scrollbar/draggable_scrollbar.dart';
import 'package:flutter/foundation.dart';
import 'package:faker/faker.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
@aravindhkumar23
aravindhkumar23 / main.dart
Last active June 9, 2020 16:38
Draw over image and export to png from canvas - flutter
import 'dart:io';
import 'dart:async';
import 'dart:typed_data';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
//import 'package:path_provider/path_provider.dart';
//import 'package:simple_permissions/simple_permissions.dart';