Skip to content

Instantly share code, notes, and snippets.

View lokeshjain2008's full-sized avatar

Lokesh Kumar Jain lokeshjain2008

View GitHub Profile
@lokeshjain2008
lokeshjain2008 / fcm_config_files_proces.js
Created April 15, 2018 09:37
Ionic cordova-plugin-fcm error fix
#!/usr/bin/env node
'use strict';
var fs = require('fs');
var path = require('path');
fs.ensureDirSync = function (dir) {
if (!fs.existsSync(dir)) {
dir.split(path.sep).reduce(function (currentPath, folder) {
currentPath += folder + path.sep;
openssl genrsa -out privkey.pem 768
openssl pkcs8 -topk8 -nocrypt -in privkey.pem -out privkey2.pem
0x6Bb565Af67683752BaEFbdFa4bE1dc9082755b34
@lokeshjain2008
lokeshjain2008 / index.html
Last active December 1, 2016 06:38 — forked from anonymous/index.html
Calculate if locations is on the routes using google mapz// source https://jsbin.com/hivuyu
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="isLocationOnEdge">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDfKLDQPQgpVU7wokCKnUgJVEB8vcwmd3g&libraries=geometry">
</script>
<title>JS Bin</title>
<style id="jsbin-css">

Programming Questions

Use a programming language of your choice

1. Complete the function caffeineBuzz, which takes a non-zero integer as it's one argument.

If the integer is divisible by 3, return the string "Java". If the integer is divisible by 3 and divisible by 4, return the string"Coffee" If the integer is one of the above and is even, add "Script" to the end of the string. Otherwise, return the string "mocha_missing!"

@lokeshjain2008
lokeshjain2008 / Slim for loop
Created November 20, 2015 19:59 — forked from beausmith/Slim for loop
Iterating through an array using a for loop in slim lang template
- for i in (1..5)
div #{i}
- for i in [0,4,8,12,16,20,24] do
div #{i} #{i + -12}
- if (i == 0)
div 0
- elsif (i < 12)
div lt 12
- else
@lokeshjain2008
lokeshjain2008 / trello-css-guide.md
Last active August 29, 2015 14:26 — forked from bobbygrace/trello-css-guide.md
Trello CSS Guide

Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

This is where any fun you might have been having ends. Now it’s time to get serious and talk about rules.

Writing CSS is hard. Even if you know all the intricacies of position and float and overflow and z-index, it’s easy to end up with spaghetti code where you need inline styles, !important rules, unused cruft, and general confusion. This guide provides some architecture for writing CSS so it stays clean and ma

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@lokeshjain2008
lokeshjain2008 / add_patch_to_project.rb
Created March 4, 2015 10:48
apply patched files to the project
def get_modified_files
files_raw = `git status | grep modified`
files_raw
.gsub(/\n/,"#")
.gsub(/[\t\n]/,"") #remove unwanted elements
.split('#').reject{|element| element.length < 2} # get each line for the file
.map{|file| file.split(":").last.strip } # git the file name
end
@lokeshjain2008
lokeshjain2008 / create_patch.rb
Created March 4, 2015 09:19
to create patch folder from git status
#get all the files changed by git
files_raw = `git status | grep modified` # => "\tmodified: tests/AllTests.php\n\tmodified: tests/RLTestConfig.php\n"
files = files_raw
.gsub(/\n/,"#")
.gsub(/[\t\n]/,"") #remove unwanted elements
.split('#').reject{|element| element.length < 2} # get each line for the file
.map{|file| file.split(":").last.strip } # git the file name
p files # => ["tests/AllTests.php", "tests/RLTestConfig.php"]