Skip to content

Instantly share code, notes, and snippets.

@akost
akost / convert.sh
Created April 4, 2012 19:06
Bash script for recursive file convertion windows-1251 --> utf-8
#!/bin/bash
# Recursive file convertion windows-1251 --> utf-8
# Place this file in the root of your site, add execute permission and run
# Converts *.php, *.html, *.css, *.js files.
# To add file type by extension, e.g. *.cgi, add '-o -name "*.cgi"' to the find command
find ./ -name "*.php" -o -name "*.html" -o -name "*.css" -o -name "*.js" -type f |
while read file
do
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 7, 2024 07:28
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@morsdyce
morsdyce / sortHtml.js
Created November 7, 2012 17:14
A function to sort a div element by its data attribute while moving html nodes without any performance hits of cloning or removing and reattaching a node.
function sortTableByColorSets() {
// store an empty object to contain all colors
var holdingCell = {};
// loop over the colors in the predfined colors array.
for (var color in colors) {
// get the color value and create a stub for it in the object. e.g object.colorname
colorValue = colors[color];
anonymous
anonymous / gist:5311068
Created April 4, 2013 14:54
public class FormHandler : DelegatingHandler
{
protected override System.Threading.Tasks.Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, System.Threading.CancellationToken cancellationToken)
{
if (request.Content != null && request.Content.Headers.ContentType != null &&
request.Content.Headers.ContentType.MediaType == "application/x-www-form-urlencoded")
{
var routeData = request.Properties["MS_HttpRouteData"] as IHttpRouteData;
var form = request.Content.ReadAsFormDataAsync().Result;
@morsdyce
morsdyce / byMultipleValues.js
Created May 29, 2013 14:45
Multiple value angular filter #angularjs #filter
'use strict';
var app = angular.module('vulcanApp');
app.filter('byMultipleValues', function() {
return function(data, params) {
if (params.length === 0) {
return data;
}
return data.filter(function(element, index) {
@morsdyce
morsdyce / exampleController.js
Created June 5, 2013 20:45
Usage of requestHandler #gisto #angular #website_embed
'use strict';
function exampleController($scope, requestHandler) {
// notifications are enabled by default, if you do not wish the notification
// to show provide the stopNotification property with the value true
requestHandler({
method: 'GET',
url: 'http://localhost/api/gist/1',
// stopNotification: true // will stop the notification from being displayed.
@JeffreyWay
JeffreyWay / .vimrc
Last active January 22, 2024 11:42
My .vimrc file
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
@hofmannsven
hofmannsven / README.md
Last active July 3, 2024 09:53
Git CLI Cheatsheet
@morsdyce
morsdyce / newFile1.txt
Created June 15, 2014 14:29 — forked from elentok/gist:3193556
Vim Hebrew edit mode
imap <f2> <c-o>:call ToggleHebrew()<cr>
map <f2> :call ToggleHebrew()<cr>
func! ToggleHebrew()
if &rl
set norl
set keymap=
else
set rl
set keymap=hebrew
@laracasts
laracasts / gist:f4a304232c1be6dbb4f8
Last active February 16, 2023 20:19
Laracasts PHPStorm theme.