Skip to content

Instantly share code, notes, and snippets.

View kalpesh-fulpagare's full-sized avatar
🎯
RubyOnRails, GoLang, AngularJS Developer

Kalpesh Fulpagare kalpesh-fulpagare

🎯
RubyOnRails, GoLang, AngularJS Developer
  • Scalefusion
  • Pune, India
View GitHub Profile
@kalpesh-fulpagare
kalpesh-fulpagare / mixins.scss
Last active September 6, 2016 14:57
Mixin for Generaing CSS classes for margin and padding.
/*
* Generate Margin/Padding Classes
* margin, margin-top, margin-bottom, margin-left, margin-right
* padding, padding-top, padding-bottom, padding-left, padding-right
*/
@mixin margin-padding($min, $max, $css-property, $klass, $csspx: $min) {
@while $min <= $max {
@if $min != 0 {
@kalpesh-fulpagare
kalpesh-fulpagare / file-joiner.sh
Last active December 27, 2018 07:27
Join Multiple Files from Linux Command Line
echo 'file-chunk'{1..19}'.ts' | tr " " "\n" > file_listing
cat file_listing
touch combined_test_file.ts
while read line; do cat $line >> combined_test_file.ts; done < file_listing
while read line; do rm -f $line; done < file_listing
rm -f file_listing
{
"always_show_minimap_viewport": false,
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
@kalpesh-fulpagare
kalpesh-fulpagare / grep.sh
Last active August 26, 2019 09:07
Grep Search
# Find requests for a Device/API
LOGFILE="log/development.log"
OUTPUT=$(grep -an 'Started PUT "/api/v1/users/information' $LOGFILE | grep -o "........-....-....-....-............" | awk 'ORS="|"')
OUTPUT=${OUTPUT%?};
echo $OUTPUT
OUTPUT=$(egrep -an $OUTPUT $LOGFILE | grep 'userid => 15841' | grep -o "........-....-....-....-............" | awk 'ORS="|"')
OUTPUT=${OUTPUT%?};
echo $OUTPUT
egrep -an $OUTPUT $LOGFILE
adb shell pm disable-user --user 0 com.oppo.market # Can not be disabled
adb shell pm disable-user --user 0 com.google.ar.core
adb shell pm disable-user --user 0 com.nearme.browser
adb shell pm disable-user --user 0 com.oppo.qualityprotect
adb shell pm disable-user --user 0 com.google.android.apps.wellbeing
adb shell pm disable-user --user 0 com.facebook.system
adb shell pm disable-user --user 0 com.facebook.services
adb shell pm disable-user --user 0 com.colouros.gamespace # Failed
adb shell pm disable-user --user 0 com.google.android.googlequick # Failed
adb shell pm disable-user --user 0 com.android.providers.partnerbookmarks
@kalpesh-fulpagare
kalpesh-fulpagare / File_rename.rb
Created July 5, 2020 06:36
Ruby Script to get timestamp from FIlename & rename the file to a common format
require 'time'
names = []
Dir.glob('*').select { |f| File.file?(f)}.each do |fn|
file_name = fn.gsub('_', '')
timestamp = Time.parse(file_name[file_name.index('20200'), 14])
ext = file_name.split(".").last.downcase
if ext == "mp4"
new_file_name = timestamp.strftime("VID%Y%m%d-%H%M%S")
else
@kalpesh-fulpagare
kalpesh-fulpagare / rails-debug.rb
Last active March 20, 2024 13:13
Handy Commands for Rails Server Debugging
# Rails console - handy commands
#
ActiveRecord::Base.logger = Logger.new(STDOUT)
# Change log level to debug
Rails.logger.level = Logger::DEBUG
# Print the line & file from where SQL got triggerred
ActiveRecord::Base.verbose_query_logs = true