Skip to content

Instantly share code, notes, and snippets.

View qalqi's full-sized avatar
🐢
I may be slow to respond.

Qalqi qalqi

🐢
I may be slow to respond.
  • Earth
View GitHub Profile
@qalqi
qalqi / Angular Components
Last active August 29, 2015 14:15
Angular Components
https://github.com/angular-ui/ui-slider
Requires
JQuery
JQueryUI
AngularJS
http://vitalets.github.io/angular-xeditable/
Angular-xeditable is a bundle of AngularJS directives that allows you to create editable elements.
Such technique is also known as click-to-edit or edit-in-place.
It is based on ideas of x-editable but was written from scratch to use power of angular and support complex forms / editable grids.
@qalqi
qalqi / EmailController.js
Last active August 29, 2015 14:16
SailsJs Mandrill Controller to send emails from SailJs
/**
* EmailController
* @require :: npm install machinepack-mandrill --save
* @model :: sails generate email
* @description :: SailsJs Server-side logic for serving Emails using Mandrill https://mandrill.com/ [12000 Free Emails]
* @help :: See http://links.sailsjs.org/docs/controllers
*/
var Mandrill = require('machinepack-mandrill');
module.exports = {
@qalqi
qalqi / loadMore.js
Last active August 29, 2015 14:17 — forked from fraserxu/loadMore.js
Load More Toggled to Load Less
// set the default amount of items being displayed
var defaultvalue = 3;
$scope.limit= defaultvalue;
$scope.ismore = false;
// loadMore function
$scope.loadMore = function() {
$scope.limit = $scope.items.length;
$scope.ismore = true;
#!/bin/bash -e
# Transforms a SVG into a PNG for each platform
# Sizes extracted from
# http://developer.android.com/design/style/iconography.html
# https://stackoverflow.com/a/23015417/2560946
[ -z $2 ] && echo -e "ERROR: filename and one dimension (-w or -h) is required, for example:\nsvg2png -w48 icon.svg\n" && exit 1;
FILENAME=$2
DEST_FILENAME=`echo $2 | sed s/\.svg/\.png/`
FLAG=`echo $1 | cut -c1-2`
<!DOCTYPE html>
<html>
<head>
<script src="https://fb.me/react-0.14.3.min.js"></script>
<script src="https://fb.me/react-dom-0.14.3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.0.4/redux.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-redux/4.0.0/react-redux.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
@qalqi
qalqi / index.js
Last active January 5, 2018 16:34
generator-react-firebase router in JSX format src/routes/index.js
import React, {Component} from 'react'
import {IndexRoute, Route, IndexRedirect} from 'react-router'
import CoreLayout from 'layouts/CoreLayout'
import LevelOneLayout from 'layouts/LevelOneLayout/LevelOneLayout';
import {
LIST_PATH,
ACCOUNT_PATH,
LOGIN_PATH,
SIGNUP_PATH,
HOME_PATH,
@qalqi
qalqi / Research to Code - Machine Learning tutorial Links
Last active July 10, 2018 06:58
Research to Code - Machine Learning tutorial Links
@qalqi
qalqi / Remove blank attributes from an Object in Javascript
Last active July 12, 2018 19:20
Remove blank attributes from an Object in Javascript
/**
* Delete all null (or undefined) properties from an object.
* Set 'recurse' to true if you also want to delete properties in nested objects.
* Source: https://stackoverflow.com/questions/286141/remove-blank-attributes-from-an-object-in-javascript
*/
function delete_null_properties(test, recurse) {
for (var i in test) {
if (test[i] === null) {
delete test[i];
} else if (recurse && typeof test[i] === 'object') {
@qalqi
qalqi / GIT.md
Last active April 3, 2020 15:50

Add to stash git stash

Add to stash including untracked git stash -u

Add to stash including untracked and ignored git stash -a

<?xml version="1.0"?>
<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" entityID="https://capriza.github.io/samling/samling.html">
<md:IDPSSODescriptor WantAuthnRequestsSigned="false" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<md:KeyDescriptor use="signing">
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:X509Data>
<ds:X509Certificate>MIICpzCCAhACCQDuFX0Db5iljDANBgkqhkiG9w0BAQsFADCBlzELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExEjAQBgNVBAcMCVBhbG8gQWx0bzEQMA4GA1UECgwHU2FtbGluZzEPMA0GA1UECwwGU2FsaW5nMRQwEgYDVQQDDAtjYXByaXphLmNvbTEmMCQGCSqGSIb3DQEJARYXZW5naW5lZXJpbmdAY2Fwcml6YS5jb20wHhcNMTgwNTE1MTgxMTEwWhcNMjgwNTEyMTgxMTEwWjCBlzELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExEjAQBgNVBAcMCVBhbG8gQWx0bzEQMA4GA1UECgwHU2FtbGluZzEPMA0GA1UECwwGU2FsaW5nMRQwEgYDVQQDDAtjYXByaXphLmNvbTEmMCQGCSqGSIb3DQEJARYXZW5naW5lZXJpbmdAY2Fwcml6YS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAJEBNDJKH5nXr0hZKcSNIY1l4HeYLPBEKJLXyAnoFTdgGrvi40YyIx9lHh0LbD