Skip to content

Instantly share code, notes, and snippets.

@xerosanyam
xerosanyam / Back Template
Last active March 24, 2023 23:31
My settings for Anki. This include 15 sec timer and left align
{{Front}}
<hr>
{{Back}}
function countDigits(digits){
var i = 0;
while(digits>0){
i++
digits = parseInt(digits/10)
}
console.log(i)
}
@xerosanyam
xerosanyam / main.js
Created October 5, 2017 12:21
add semantic ui to vuejs
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
window.$ = window.jQuery = require('jquery')
require('semantic-ui-css/semantic.css')
require('semantic-ui-css/semantic.js')
Vue.config.productionTip = false
@xerosanyam
xerosanyam / userSettings.js
Created October 5, 2017 11:09
VSCode settings for Vue
{
"eslint.enable": true,
"eslint.validate": [
{ //list of extensions to validate
"language": "html",
"autoFix": true
},
{
"language": "vue",
"autoFix": true //Autofix any fixable errors when linting
@xerosanyam
xerosanyam / step 2.js
Created June 28, 2017 09:18
second step
<!-- contains what to do on signin succss -->
<template>
<div>
<h1>Signup succeeded</h1>
<button @click='logOut'>Log out</button>
<hr>
<img :src="photo" style='height: 120px'> <br>
<p>{{name}}</p>
<p>{{email}}</p>
<p>{{userId}}</p>
@xerosanyam
xerosanyam / auth 1.js
Created June 28, 2017 09:17
first step
<!-- Contains auth ui -->
<template lang="html">
<div id="firebaseui-auth-container"></div>
</template>
<script>
import firebase from 'firebase'
import firebaseui from 'firebaseui'
import {config} from '../helpers/firebaseConfig';
@xerosanyam
xerosanyam / giphy.js
Created May 18, 2017 05:01 — forked from nealrs/giphy.js
use the giphy api to search for & add an animated gif to a webpage.
// on page load, search for & display a random gif matching your search term using the Giphy API.
// usage:
// include giphy.js in your <head>
// set q to your search term (e.g. "brunch")
// add <span id = "giphyme"></span> wherever you want to display the image. -- FYI, it will be centered.
// big ups to the Giphy crew (giphy.com)
// 2014 - Neal Shyam [@nealrs | nealshyam.com]
document.addEventListener('DOMContentLoaded', function () {
q = "finger guns"; // search query
@xerosanyam
xerosanyam / Settinp up nginx as Static File Server (Minimal)
Last active May 30, 2016 18:05
Settinp up nginx as Static File Server (Minimal)
sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
sudo apt-get install nginx
nginx -v
http://app.mindmapmaker.org/#m:mm494aabe32c8e4144829c631c0870a230
To start nginx (Linux)
sudo /etc/init.d/nginx start
@xerosanyam
xerosanyam / README.md
Created March 8, 2016 15:37 — forked from estebistec/README.md
This minimal setup allows you to run nginx using the current folder as the doc-root.NOTE: python's simplehttpserver may be good enough for you. This is just a nice simple nginx setup.
  1. Get all of these files into the target folder
  2. Run the following commands:
chmod +x *.sh
./nginx-start.sh
@xerosanyam
xerosanyam / GeeksForGeeks Bullets to Numbers.user.js
Created July 12, 2015 07:23
GeeksForGeeks Bullets to Numbers
// ==UserScript==
// @name Xerosanyam's script to convert UL to OL
// @description This script converts all ul tags to ol on GeeksforGeeks.org Domain.
// @namespace http://www.geeksforgeeks.org/ul-to-ol
// @include http://www.geeksforgeeks.org/*
// @grant None
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js
// ==/UserScript==
$($('.wrapper').find('ul').get().reverse()).each(function(){