Skip to content

Instantly share code, notes, and snippets.

@delirehberi
delirehberi / selection-remove.js
Created October 18, 2015 14:35
Bootstrapped selection remove for multiple selectbox.
$("select[multiple]").each(function () {
$(this).parents('.form-group').append('<a href=# class="remove-selection"><i class="entypo-cancel"></i></a>')
});
$(document).on('click','.remove-selection',function(){
$(this).parents('.form-group').find('select').find('option:selected').each(function(i,o){
o.selected = false;
});
return false;
})
````
`-+ydmNNNNNNNNmmhs/-
.+hNMMMMMMMMMMMMMMMMMMMNy+`
.omMMMMMMMMMMMMMMMMMMMMMMMMMMNh/`
:hMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNy.
-dMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMN/
+NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMs
+MMMMMMMMMMMMNmddddmNMMMNddhhdmNMMMMMMMMMMMy
-NMMMMMMMNho:. .-` `:ohNMMMMMMMy
`` `mMMMMMMd+` `+mMMMMMMs `-`
@delirehberi
delirehberi / tests.md
Last active December 9, 2018 21:17
Tests , source : softwaretestinghelp.com

General Test Scenarios

  • All mandatory fields should be validated and indicated by asterisk (*) symbol
  • Validation error messages should be displayed properly at correct position
  • All error messages should be displayed in same CSS style (e.g. using red color)
  • General confirmation messages should be displayed using CSS style other than error messages style (e.g. using green color)
  • Tool tips text should be meaningful
  • Dropdown fields should have first entry as blank or text like ‘Select’
  • Delete functionality for any record on page should ask for confirmation
  • Select/deselect all records options should be provided if page supports record add/delete/update functionality
@delirehberi
delirehberi / analytics.php
Created December 9, 2018 20:52
i3blocks analytics
#!/usr/bin/php
<?php
$view_id = "";
$token = "";
$key = "";
echo "Realtime: " . request($view_id, $token, $key);
function request($id, $token, $key)
{
@delirehberi
delirehberi / todo.hs
Created August 20, 2019 21:52
todo.haskell
--my first real haskell app
import System.Environment
import System.Directory
import System.IO
import Data.List
dispatch :: [(String, [String] -> IO ())]
dispatch = [
("add",add),
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
module InstagramService.Client where
import Control.Monad (unless)
import GHC.Generics
import Network.Socket hiding (recv)
import Network.Socket.ByteString.Lazy (recv,sendAll)
import Data.Aeson
data EmulatorRequestParameters = UserRequest {
@delirehberi
delirehberi / road.hs
Last active February 22, 2020 01:40
shortest_way.hs
import Data.List
main = do
contents <- getContents
let
threes = groupsOf 3 (map read $ lines contents)
roadSystem = map (\[a,b,c] -> Section a b c) threes
path = optimalPath roadSystem
pathString = concat $ map (show . fst) path
pathPrice = sum $ map snd path
version: '3'
services:
php:
build:
context: ./docker/php
ports:
- 9000:9000
volumes:
- ./:/app/
- ./docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf
{ pkgs ? import <nixpkgs> {} }:
let
ihpDev = builtins.fetchTarball {
url= "https://beta:beta@ihp.digitallyinduced.com/ihp-new.tar.gz";
sha256 = "0kmrb8w96qpwfjm8h3fa8dpmz94zl096n5xvsdgkk70gw76hjg1m";
};
NB_USER = "ihp";
NB_UID = "1000";
dockerEtc = pkgs.runCommand "docker-etc" {} ''
mkdir -p $out/etc/pam.d
@delirehberi
delirehberi / soundcloud.js
Created July 20, 2020 23:23
soundcloud bulk delete
//go to that location
window.location = "https://soundcloud.com/you/tracks";
//select all tracks on the page.
document.querySelectorAll("input[type='checkbox']").forEach((a,b)=>{a.click();});
//define remover function
let remover = function(){
let a = document.querySelector(".trackManagerTrackList__item");
if(!a) {
clearInterval(window.d);
}