Skip to content

Instantly share code, notes, and snippets.

View ecaepsey's full-sized avatar
🏠
Working from home

Damir Aushenov ecaepsey

🏠
Working from home
  • Keremet Bank
  • Kyrgyzstan
View GitHub Profile
@jacksonfdam
jacksonfdam / gist:3000275
Created June 26, 2012 23:56
Regular Expressions List
//Regular Expressions List
//Short Tutorial
\ // the escape character - used to find an instance of a metacharacter like a period, brackets, etc.
. // match any character except newline
x // match any instance of x
^x // match any character except x
[x] // match any instance of x in the bracketed range - [abxyz] will match any instance of a, b, x, y, or z
| // an OR operator - [x|y] will match an instance of x or y
@bergantine
bergantine / gist:5243223
Last active September 27, 2018 03:04
CSS grayscale filter (go from grayscale to full color on hover) #css #sethneilson
img:hover {
-webkit-filter: grayscale(0%);
-webkit-transition: .5s ease-in-out;
-moz-filter: grayscale(0%);
-moz-transition: .5s ease-in-out;
-o-filter: grayscale(0%);
-o-transition: .5s ease-in-out;
}
img {
@marchawkins
marchawkins / get-weather.html
Created March 9, 2014 08:17
Use the OpenWeatherMap api to retrieve current weather conditions by providing an address or latitude and longitude. Uses the OpenWeatherMap API (http://openweathermap.org/) to get the data. Data is returned in JSON format. For this test, input an address and hit the "Get Weather" button. The current weather conditions will be shown in the texta…
<div class="row">
<div class="col-md-2 col-sm-2 col-xs-2">
<p><button class="btn btn-primary btn-sm" id="get-weather-btn"><span>Get Weather</span></button></p>
</div><!-- .col -->
<div class="col-md-10 col-sm-10 col-xs-10">
<div class="panel panel-default">
<div class="panel-heading">OpenWeatherMap API Response</div>
<div class="panel-body">
<p>Enter Address: <input type="text" id="address" class="form-control" placeholder="City, State"/></p>
<textarea id="weather" class="form-control"></textarea>
@esfand
esfand / angular-jqlite.adoc
Last active April 19, 2023 01:32
Angular jqLite

Angular jqLite

jQuery and Angular

Angular doesn’t depend on jQuery. In fact, the Angular source contains an embedded lightweight alternative: jqLite. Still, when Angular detects the presence of a jQuery version in your page, it uses that full jQuery implementation in lieu of jqLite. One direct way in which this manifests itself is with Angular’s element abstraction. For example, in a directive you get access to the element that the directive applies to:

@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 14, 2024 04:49
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@joshuadutton
joshuadutton / CollectionViewCellConfigurable.swift
Last active February 15, 2022 10:52
Generic Collection View and Table View data sources in Swift
import UIKit
protocol CollectionViewCellConfigurable {
typealias ItemType
typealias CellType: UICollectionViewCell
static func reuseIdentifierForIndexPath(indexPath: NSIndexPath) -> String
static func configureCellAtIndexPath(indexPath: NSIndexPath, item: ItemType, cell: CellType)
}
@cbess
cbess / Log.swift
Last active September 2, 2021 07:25
Simple Logger class in Swift 4.x
import Foundation
/// Represents the Log facilities
struct Log {
/// Prints in debug only
static func debug(_ msg: String, line: Int = #line, fileName: String = #file, funcName: String = #function) {
#if DEBUG
let fname = (fileName as NSString).lastPathComponent
print("[\(fname) \(funcName):\(line)]", msg)
#endif
@hassy
hassy / my-test.yml
Created March 31, 2016 20:17
Example of using processors in Artillery
config:
target: "http://localhost:8080"
phases:
- duration: 60
arrivalRate: 1
processor: "./processor.js"
scenarios:
- name: "Load the options page"
flow:
- get:
@markerikson
markerikson / redux-thunk-examples.js
Last active September 4, 2022 11:12
Redux-Thunk examples
// The classic AJAX call - dispatch before the request, and after it comes back
function myThunkActionCreator(someValue) {
return (dispatch, getState) => {
dispatch({type : "REQUEST_STARTED"});
myAjaxLib.post("/someEndpoint", {data : someValue})
.then(
response => dispatch({type : "REQUEST_SUCCEEDED", payload : response}),
error => dispatch({type : "REQUEST_FAILED", error : error})
);