Skip to content

Instantly share code, notes, and snippets.

/*
*
* Sortera Close Variants med Levenshtein Distance
*
* Levenshtein Distance i korthet = antal tecken du
* måste ändra för att kunna skapa två lika strängar.
*
* För mer info: http://en.wikipedia.org/wiki/Levenshtein_distance
*
*/
@BedyaEG
BedyaEG / c.py
Created January 2, 2019 07:11 — forked from paperclip/c.py
From http://thedailywtf.com/Comments/The-Regex-Code-Review.aspx - python implementation of three alternatives
#!/usr/bin/env python
import re
class Simple(object):
def __init__(self, searchterms):
self.__m_searchterms = searchterms
def isMatch(self, text):
for term in self.__m_searchterms:
@BedyaEG
BedyaEG / chrome-keywords.sql
Created January 2, 2019 07:11
Google Chrome Keywords Export
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE "keywords" (id INTEGER PRIMARY KEY,short_name VARCHAR NOT NULL,keyword VARCHAR NOT NULL,favicon_url VARCHAR NOT NULL,url VARCHAR NOT NULL,show_in_default_list INTEGER,safe_for_autoreplace INTEGER,originating_url VARCHAR,date_created INTEGER DEFAULT 0,usage_count INTEGER DEFAULT 0,input_encodings VARCHAR,suggest_url VARCHAR,prepopulate_id INTEGER DEFAULT 0,autogenerate_keyword INTEGER DEFAULT 0,logo_id INTEGER DEFAULT 0,created_by_policy INTEGER DEFAULT 0,instant_url VARCHAR);
INSERT INTO "keywords" VALUES(2,'Google','g','http://www.google.com/favicon.ico','{google:baseURL}search?{google:RLZ}{google:acceptedSuggestion}{google:originalQueryForSuggestion}sourceid=chrome&ie={inputEncoding}&q={searchTerms}',1,0,'',0,46,'UTF-8','{google:baseSuggestURL}search?client=chrome&hl={language}&q={searchTerms}',1,0,6247,0,'{google:baseURL}webhp?{google:RLZ}sourceid=chrome-instant&ie={inputEncoding}&ion=1{searchTerms}');
INSERT INTO "keywords" VALUES(5,'Quix','q','','j
@BedyaEG
BedyaEG / SearchProviders.plist
Created January 2, 2019 07:11 — forked from indirect/SearchProviders.plist
SafariOmnibar search keywords
<key>SafariOmnibar_SearchProviders</key>
<array>
<dict>
<key>Name</key>
<string>Google</string>
<key>Keyword</key>
<string>g</string>
<key>Default</key>
<true/>
<key>SearchURLTemplate</key>
@BedyaEG
BedyaEG / fa.js
Created January 2, 2019 07:11 — forked from neldrine/fa.js
/*!
* Font Awesome Icon Picker
* https://farbelous.github.io/fontawesome-iconpicker/
*
* Originally written by (c) 2016 Javi Aguilar
* Licensed under the MIT License
* https://github.com/farbelous/fontawesome-iconpicker/blob/master/LICENSE
*
*/
(function(a) {
@BedyaEG
BedyaEG / mosre_hastle_than_its_worth.php
Created January 2, 2019 07:11 — forked from chrisjsimpson/mosre_hastle_than_its_worth.php
php cli exploit-db.com search via command line
<?php
/* Terminal sript for fast searching of the exploit-db.com/search page
*
* Requires: php5, curl, php-cli, w3m (use sudo apt-get install programName)
*
* For defaults just leave questions blank & press enter.
*
* Notes for improvement:
* > No pagination support (only shows page one of results)
* > Writes search result to a file- this is messy, must be better way
/*!
* Font Awesome Icon Picker
* https://farbelous.github.io/fontawesome-iconpicker/
*
* Originally written by (c) 2016 Javi Aguilar
* Licensed under the MIT License
* https://github.com/farbelous/fontawesome-iconpicker/blob/master/LICENSE
*
*/
(function(a) {
window.App = angular.module('desidancevids',[
'templates',
'ui.router',
'ngResource',
'ui.bootstrap'
])
App.config ["$httpProvider", ($httpProvider) ->
# Inject the CSRF token
$httpProvider.defaults.headers.common['X-CSRF-Token'] = document.getElementsByName("csrf-token")[0].content
/*******************
* multiplicity.js *
*******************
*
* Out of one cell and into another. They're not giving you
* very much to work with here, either. Ah, well.
*
* Level filenames can be hints, by the way. Have I
* mentioned that before?
*
@BedyaEG
BedyaEG / make_pipeline.php
Created January 2, 2019 07:10 — forked from kenjipm/make_pipeline.php
As part of a data processing pipeline, complete the implementation of the make_pipeline method: The method should accept a variable number of functions, and it should return a new function that accepts one parameter $arg. The returned function should call the first function in the make_pipeline with the parameter $arg, and call the second functi…
<?php
class Pipeline
{
public static function make_pipeline(...$funcs)
{
return function($arg) use ($funcs)
{
foreach ($funcs as $func)
{
$arg = $func($arg);