Skip to content

Instantly share code, notes, and snippets.


Lokesh Kumar Jain lokeshjain2008

View GitHub Profile
lokeshjain2008 / fcm_config_files_proces.js
Created Apr 15, 2018
Ionic cordova-plugin-fcm error fix
View fcm_config_files_proces.js
#!/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;
View openssl pkcs8 -topk8 -nocrypt -in privkey.pem -out privkey2.pem 76
openssl genrsa -out privkey.pem 768
openssl pkcs8 -topk8 -nocrypt -in privkey.pem -out privkey2.pem
View testgetether
lokeshjain2008 / index.html
Last active Dec 1, 2016 — forked from anonymous/index.html
Calculate if locations is on the routes using google mapz// source
View index.html
<!DOCTYPE html>
<meta name="description" content="isLocationOnEdge">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="">
<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 / Slim for loop
Created Nov 20, 2015 — forked from beausmith/Slim for loop
Iterating through an array using a for loop in slim lang template
View Slim for loop
- 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

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 / add_patch_to_project.rb
Created Mar 4, 2015
apply patched files to the project
View add_patch_to_project.rb
def get_modified_files
files_raw = `git status | grep modified`
.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
lokeshjain2008 / create_patch.rb
Created Mar 4, 2015
to create patch folder from git status
View create_patch.rb
#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(/[\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"]